mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
test/atomicity: guard chert-only optimization
This should potentially be updated to have an equivalent optimization for the glass backend, but it in my unscientific tests, the glass backend without the optimization is faster then the chert backend with.
This commit is contained in:
parent
45df509cb6
commit
45a0ab9e84
1 changed files with 13 additions and 10 deletions
|
@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint):
|
|||
self.n = 0
|
||||
|
||||
def stop(self):
|
||||
# As an optimization, only consider snapshots after a Xapian
|
||||
# has really committed. Xapian overwrites record.base? as the
|
||||
# last step in the commit, so keep an eye on their inumbers.
|
||||
inodes = {}
|
||||
for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir):
|
||||
inodes[path] = os.stat(path).st_ino
|
||||
if inodes == self.last_inodes:
|
||||
# Continue
|
||||
return False
|
||||
self.last_inodes = inodes
|
||||
xapiandir = '%s/.notmuch/xapian' % maildir
|
||||
if os.path.isfile('%s/iamchert' % xapiandir):
|
||||
# As an optimization, only consider snapshots after a
|
||||
# Xapian has really committed. The chert backend
|
||||
# overwrites record.base? as the last step in the commit,
|
||||
# so keep an eye on their inumbers.
|
||||
inodes = {}
|
||||
for path in glob.glob('%s/record.base*' % xapiandir):
|
||||
inodes[path] = os.stat(path).st_ino
|
||||
if inodes == self.last_inodes:
|
||||
# Continue
|
||||
return False
|
||||
self.last_inodes = inodes
|
||||
|
||||
# Save a backtrace in case the test does fail
|
||||
backtrace = gdb.execute('backtrace', to_string=True)
|
||||
|
|
Loading…
Reference in a new issue