Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-387

BTree.removeAll() must delete nodes and leaves for RWStore even if delete markers are not in use.

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: JOURNAL_HA_BRANCH
    • Fix Version/s: None
    • Component/s: B+Tree

      Description

      BTree.removeAll() will simply replace the root leaf if delete markers are not in use. When they are in use, it will delete all tuples. For the RWStore, we must explicitly cause the nodes and leaves associated with the BTree to be deleted or those allocation slots will never be recycled.

      Add an exception for the RWStore to BTree.removeAll().

      Consider an optimized version of removeAll() which explicit traverses the nodes and leaves issuing deletes against the store without causing the individual tuples to be removed. This should be significantly faster since the nodes and leaves will not be updated as a side effect as the tuples are deleted.

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        Martyn, could you please take a look at the change to BTree#removeAll() for a second set of eyes on this RWStore specific optimization? If it looks good to you, then please close out this issue.

        Added an efficient code path for BTree#removeAll() when using the RWStore without delete markers for the index. There is now a unit test for this code path in TestRWJournal.

        Committed revision r4265.

        Thanks,
        Bryan

        Show
        bryanthompson bryanthompson added a comment - Martyn, could you please take a look at the change to BTree#removeAll() for a second set of eyes on this RWStore specific optimization? If it looks good to you, then please close out this issue. Added an efficient code path for BTree#removeAll() when using the RWStore without delete markers for the index. There is now a unit test for this code path in TestRWJournal. Committed revision r4265. Thanks, Bryan
        Hide
        bryanthompson bryanthompson added a comment -

        Martyn,

        I've also modified AbstractJournal#dropIndex() to invoke removeAll() on the index if the backing store is the RWStrategy in order to reclaim the associated storage. Please take a look around and see if there are any other code paths where we might have to do this.

        Thanks,
        Bryn

        Show
        bryanthompson bryanthompson added a comment - Martyn, I've also modified AbstractJournal#dropIndex() to invoke removeAll() on the index if the backing store is the RWStrategy in order to reclaim the associated storage. Please take a look around and see if there are any other code paths where we might have to do this. Thanks, Bryn

          People

          • Assignee:
            martyncutcher martyncutcher
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: