{"action":"reopened","issue":{"url":"https://api.github.com/repos/cojen/Tupl/issues/47","repository_url":"https://api.github.com/repos/cojen/Tupl","labels_url":"https://api.github.com/repos/cojen/Tupl/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/cojen/Tupl/issues/47/comments","events_url":"https://api.github.com/repos/cojen/Tupl/issues/47/events","html_url":"https://github.com/cojen/Tupl/issues/47","id":132016007,"number":47,"title":"Corruption caused by concurrent reverse deletes","user":{"login":"broneill","id":2822640,"avatar_url":"https://avatars.githubusercontent.com/u/2822640?v=3","gravatar_id":"","url":"https://api.github.com/users/broneill","html_url":"https://github.com/broneill","followers_url":"https://api.github.com/users/broneill/followers","following_url":"https://api.github.com/users/broneill/following{/other_user}","gists_url":"https://api.github.com/users/broneill/gists{/gist_id}","starred_url":"https://api.github.com/users/broneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broneill/subscriptions","organizations_url":"https://api.github.com/users/broneill/orgs","repos_url":"https://api.github.com/users/broneill/repos","events_url":"https://api.github.com/users/broneill/events{/privacy}","received_events_url":"https://api.github.com/users/broneill/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cojen/Tupl/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-07T21:43:34Z","updated_at":"2016-02-12T01:49:01Z","closed_at":null,"body":"- Thread0 is inserting entries in random order into index0\r\n- Thread1 is iterating over index0 and moving entries to index1\r\n- Thread2 is iterating over index1 in reverse and moving entries to index2\r\n\r\nSometimes this happens:\r\n\r\nPANIC: Closing database due to unhandled exception: java.lang.AssertionError: Already in NodeMap: LeafNode: {id=290175, cachedState=3, isSplit=false, availableBytes=1364, extremity=0b0, latchState=org.cojen.tupl.Node@7cca494b[State = -2147483648, empty queue]}, LeafNode: {id=290175, cachedState=0, isSplit=false, availableBytes=4, extremity=0b0, latchState=org.cojen.tupl.Node@7ba4f24f[State = 0, empty queue]}, 290175\r\n        at org.cojen.tupl.LocalDatabase.nodeMapPut(LocalDatabase.java:2706)\r\n        at org.cojen.tupl.LocalDatabase.nodeMapPut(LocalDatabase.java:2685)\r\n        at org.cojen.tupl.LocalDatabase.doMarkDirty(LocalDatabase.java:3170)\r\n        at org.cojen.tupl.LocalDatabase.markDirty(LocalDatabase.java:3045)\r\n        at org.cojen.tupl.TreeCursor.notSplitDirty(TreeCursor.java:3626)\r\n        at org.cojen.tupl.TreeCursor.store(TreeCursor.java:2382)\r\n        at org.cojen.tupl.TreeCursor.doFindAndStore(TreeCursor.java:2116)\r\n        at org.cojen.tupl.TreeCursor.findAndStore(TreeCursor.java:2084)\r\n        at org.cojen.tupl.Tree.store(Tree.java:355)\r\n\r\nWhen verifying the database:\r\n\r\nVerification failure: index=1593915264256456714, node=290175, level=4: Child keys are not less than parent key: BottomInternalNode: {id=547076, cachedState=0, isSplit=false, availableBytes=7, extremity=0b0, latchState=org.cojen.tupl.Node@25f38edc[State = 0, empty queue]}\r\n\r\nIn most cases, the node in the assertion is not the one found by verification. The following causes have been ruled out:\r\n\r\n- Version 1.3 is not to blame. Problem was reproduced with version 1.2.\r\n- Node recycling is not to blame. Disabling it didn't prevent the problem.\r\n\r\nIt appears that a leaf node was deleted, but for some reason it was still referenced by the parent node. The reference also still exists in the node map, which is at least consistent."}}