hanoidb icon indicating copy to clipboard operation
hanoidb copied to clipboard

hanoidb can't recover when one of the database files does not exists in merge process.

Open brigadier opened this issue 10 years ago • 0 comments

It looks like hanoidb can't recover when one of the database A or B files does not exists in merge process. When hanoidb files get damaged and hanoidb_merger:merge gets an error such as

23:09:07.647 [error] CRASH REPORT Process <0.8817.0> with 0 neighbours crashed with reason: no match of right hand value {error,enoent} in hanoidb_merger:merge/6 line 68
23:09:07.648 [error] Merger appears to have failed (reason: {badmatch,{error,enoent}}). Removing outfile database/client/data.hanoidb/X-9.data
23:09:07.648 [error] merge failed error:{badmatch,{error,enoent}} [{hanoidb_merger,merge,6,[{file,"src/hanoidb_merger.erl"},{line,68}]},{hanoidb_level,'-begin_merge/1-fun-0-',5,[{file,"src/hanoidb_level.erl"},{line,789}]},{proc_lib,init_p,3,[{file,"proc_lib.erl"},{line,224}]}]

it enters infinite loop in restart_merge_then_loop, keeps throwing this error and crashes the virtual machine by OOM.

To repeat the problem delete a couple of A/B database files while hanoidb runs and apply some load to the hanoidb to trigger merging

brigadier avatar Sep 22 '15 20:09 brigadier