Skip to content

Commit ecccf32

Browse files
zzl0meta-codesync[bot]
authored andcommitted
transaction: skip lock-free journal undo
Summary: Lock-free transactions do not own `journal*` files, so do not move them to undo files. Reviewed By: quark-zju Differential Revision: D109166273 fbshipit-source-id: 21c12ead3de520d12df1541a3ef9373c69a8534c
1 parent 2d2e68e commit ecccf32

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

eden/scm/sapling/localrepo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,9 +1790,12 @@ def transaction(self, desc, report=None, lockfree=False):
17901790
txnid = "TXN:" + ha
17911791
self.hook("pretxnopen", throw=True, txnname=desc, txnid=txnid)
17921792

1793+
# Lock-free transactions do not create fixed journal files.
17931794
if not lockfree:
17941795
self._writejournal(desc)
1795-
renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
1796+
renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
1797+
else:
1798+
renames = []
17961799
if report:
17971800
rp = report
17981801
else:

eden/scm/tests/test-transaction-missing-journal-dirstate.t

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@ Lock-free transaction close must not move another transaction's journals.
3838
$ touch $TESTTMP/go
3939
$ wait
4040
$ cat $TESTTMP/out
41-
abort: $ENOENT$: $TESTTMP/repo/.sl/journal.dirstate (no-windows !)
42-
abort: $TESTTMP\repo\.sl\journal.dirstate: $ENOENT$. (windows !)

0 commit comments

Comments
 (0)