ceskaexpedice / kramerius

System Kramerius
GNU General Public License v3.0
45 stars 26 forks source link

Funkcia force delete #942

Closed rrandiak closed 1 year ago

rrandiak commented 1 year ago

V prípade, že sa dokument dostane do nekonzistentného stavu, nie je možné s ním robiť žiadne úkony. Každý proces skončí výnimkou objekt je v nekonzistentom stave. Nefunguje ani mazanie ani reimport. Väčšinou keď nastane taký prípad musíme ručne vymazať všetky záznamy z processing a search Solru. Bolo by dobré keby bola pri procese "delete_tree" možnosť "force", ktorá by ignorovala nekonzistenciu.

Príklad 1: chyba na ktorej spadne mazanie: SEVERE: null java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at cz.incad.kramerius.processes.starter.ProcessStarter.main(ProcessStarter.java:125) Caused by: cz.incad.kramerius.resourceindex.ResourceIndexException: java.io.IOException: object uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f not found or error reading it: {"message":"found multiple own parent relations: uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867 -hasVolume-> uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f and uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867 -hasVolume-> uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f"}

v processing Solri sa nachádza: { "source":"uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867", "type":"relation", "relation":"hasVolume", "targetPid":"uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f", "pid":"relation|uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867|hasVolume|uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f", "_version_":1751934901001650179}, { "source":"uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867", "type":"relation", "relation":"hasVolume", "targetPid":"uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f", "pid":"relation|uuid:20e06c60-a0cd-11ea-be02-5ef3fc9ae867|hasVolume|uuid:e83025e0-72c7-11eb-868e-5ef3fc9bb22f", "_version_":1754843472881254407}]

Príklad 2: mazanie spadne na: SEVERE: null java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at cz.incad.kramerius.processes.starter.ProcessStarter.main(ProcessStarter.java:125) Caused by: java.lang.NullPointerException at cz.kramerius.searchIndex.repositoryAccessImpl.krameriusNewApi.ResourceIndexImplByKrameriusNewApis.getModel(ResourceIndexImplByKrameriusNewApis.java:33) at cz.incad.kramerius.DeleteTreeProcess.deleteTree(DeleteTreeProcess.java:125) at cz.incad.kramerius.DeleteTreeProcess.main(DeleteTreeProcess.java:108) v search Solri ostane: { "pid":"uuid:4e9a1880-11d5-11eb-a4cf-005056827e52", "_version_":1759628489593454592}]

Príklad 3: mazanie spadne na: SEVERE: null java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at cz.incad.kramerius.processes.starter.ProcessStarter.main(ProcessStarter.java:125) Caused by: java.lang.NullPointerException v processing Solri ostane: { "source":"uuid:800b7b40-4f31-11eb-9496-005056827e52", "type":"relation", "relation":"hasVolume", "targetPid":"uuid:01f83210-5efa-11eb-b4d1-005056827e51", "pid":"relation|uuid:800b7b40-4f31-11eb-9496-005056827e52|hasVolume|uuid:01f83210-5efa-11eb-b4d1-005056827e51", "_version_":1712551089074601984}]

Toto všetko ovplyvňuje následný reimport, ktorý padá na nejakej nekonzistencií, ktorá sa nedá vymazať inak ako v Solri.

pavel-stastny commented 1 year ago

@r2it-git Funkce force delete je problematicka, protoze nekonzitence mohou byt ruzneho typu a nejde to uplne osterit, V komitu jsou zahrnuto to aby proces nevyhazoval NPE. Zaroven pridan checkbox, ktery umozni beh procesu i kdyz je nekonzistence mezi processing indexem a repozitarem Akubra.

pavel-stastny commented 1 year ago

@r2it-git Zahrnuto do releasu ale obávám se, že na nekonzistence v repositáři bude muset být vyvinutý samostatný nástroj.