This is an archive of the discontinued Mercurial Phabricator instance.

rust-nodemap: accounting for dead blocks
ClosedPublic

Authored by marmoute on Feb 8 2020, 12:45 PM.

Details

Summary

By the very append-only nature of the NodeTree, inserting
new blocks has the effect of making some of the older ones
useless as they become unreachable.

Therefore some automatic housekeeping will need to be provided.
This is standard procedure in the word of databases, under names
such as "repack" or "vacuum".

The new masked_readonly_blocks() will provide callers with
useful information to decide if the nodetree is ripe for
repacking, but all the NodeTree can provide is how many
blocks have been masked in the currently mutable part. Analysing
the readonly part would be way too long to do it for each
transaction and defeat the whole purpose of nodemap persistence.
Serializing callers (from the Python layer) will get this figure
before each extraction and maintain an aggregate counter of
unreachable blocks separately.

Note: at this point, the most efficient repacking is just to restart
afresh with a full rescan.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

marmoute created this revision.Feb 8 2020, 12:45 PM
Alphare updated this revision to Diff 20219.Feb 14 2020, 6:02 AM
Alphare updated this revision to Diff 20238.Feb 15 2020, 6:50 AM
Alphare updated this revision to Diff 20279.Feb 24 2020, 5:13 AM
kevincox accepted this revision.Feb 24 2020, 5:45 AM
Alphare updated this revision to Diff 20284.Feb 24 2020, 8:15 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.