( )⚙ D112 undo: move undolog to vfs and mark as lock-safe

This is an archive of the discontinued Mercurial Phabricator instance.

undo: move undolog to vfs and mark as lock-safe
ClosedPublic

Authored by quark on Jul 17 2017, 4:56 PM.

Details

Reviewers
durham
ryanmce
Group Reviewers
Restricted Project
Commits
rFBHGX910ef98c3557: undo: move undolog to vfs and mark as lock-safe
Summary

The upstream has added some warning around repo.svfs/vfs write operations
without taking locks. For undo, we don't want to take the repo lock (since
that means read-only operations like hg log will be blocked by another
hg commit). So undo has its own locking and own transaction (for lower
overhead). Therefore move all files we may write (including lock and
transaction files) to .hg/undolog and whitelist the directory at
localrepository._wlockfreeprefix to bypass the checks.

Diff Detail

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

Event Timeline

quark created this revision.Jul 17 2017, 4:56 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 17 2017, 4:56 PM
durham edited edge metadata.Jul 18 2017, 6:18 AM

Why not just use the normal vfs? Then you don't need your own vfs object. The undo log can be written to even if only the working copy or bookmarks change (so no store lock was ever taken), so it seems like it would live at the .hg level instead of the store level?

In D112#1789, @durham wrote:

Why not just use the normal vfs? Then you don't need your own vfs object. The undo log can be written to even if only the working copy or bookmarks change (so no store lock was ever taken), so it seems like it would live at the .hg level instead of the store level?

Good point. IIRC the choice of svfs was because repo.transaction somehow hardcodes it to track revlogs. Since we have our own transaction now I'll try to use vfs.

quark edited the summary of this revision. (Show Details)Jul 18 2017, 1:28 PM
quark retitled this revision from undo: bypass svfs audit check to undo: move undolog to vfs and mark as lock-safe.
quark updated this revision to Diff 272.
ryanmce accepted this revision.Jul 18 2017, 1:41 PM
ryanmce added a subscriber: ryanmce.

If this fixes the test, I'm totes in favor!

This revision is now accepted and ready to land.Jul 18 2017, 1:41 PM
This revision was automatically updated to reflect the committed changes.