]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/stack: gracefully handle failed auto-compaction due to locks
authorPatrick Steinhardt <ps@pks.im>
Mon, 25 Mar 2024 10:02:50 +0000 (11:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2024 16:54:07 +0000 (09:54 -0700)
commita2f711ade0c4816a59155d72559cbc4759cd4699
tree5c3a8c6423e640d428a4ef88875269bae32a0ef4
parent33358350eb857a5fb273d143dcdfe15ac6d4db5d
reftable/stack: gracefully handle failed auto-compaction due to locks

Whenever we commit a new table to the reftable stack we will end up
invoking auto-compaction of the stack to keep the total number of tables
at bay. This auto-compaction may fail though in case at least one of the
tables which we are about to compact is locked. This is indicated by the
compaction function returning `REFTABLE_LOCK_ERROR`. We do not handle
this case though, and thus bubble that return value up the calling
chain, which will ultimately cause a failure.

Fix this bug by ignoring `REFTABLE_LOCK_ERROR`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/stack.c
reftable/stack_test.c
t/t0610-reftable-basics.sh