diff options
author | Christopher Baines <mail@cbaines.net> | 2020-06-23 17:36:49 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-09-14 10:51:26 +0200 |
commit | 2932591b8aeec89732c8f8faa0d3f8ef900e68d2 (patch) | |
tree | a2f7bc04ccb63e053e4765ab1249a74f39066c90 /gnu/packages/textutils.scm | |
parent | a05c31ab3007a7a60f735ed7405fb9c54be1728d (diff) | |
download | guix-2932591b8aeec89732c8f8faa0d3f8ef900e68d2.tar.gz |
database: register-items: reduce transaction scope.
It was made transactional in a4678c6ba18d8dbd79d931f80426eebf61be7ebe, with the reasoning to prevent broken intermediate states from being visible. I think this means something like an entry being in ValidPaths, but the Refs not being inserted. Using a transaction for this makes sense, but I think using one single transaction for the whole register-items call is unnecessary to avoid broken states from being visible, and could block other writes to the store database while register-items is running. Because the deduplication and resetting timestamps happens within the transaction as well, even though these things don't involve the database, writes to the database will still be blocked while this is happening. To reduce the potential for register-items to block other writers to the database for extended periods, this commit moves the transaction to just wrap the call to sqlite-register. This is the one place where writes occur, so that should prevent the broken intermediate states issue above. The one difference this will make is some of the registered items will be visible to other connections while others may be still being added. I think this is OK, as it's equivalent to just registering different items. * guix/store/database.scm (register-items): Reduce transaction scope. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/textutils.scm')
0 files changed, 0 insertions, 0 deletions