summaryrefslogtreecommitdiff
path: root/t/unit-tests/u-reftable-stack.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-08-12 11:54:20 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-12 07:41:00 -0700
commit54d25de3ea93d42457bfdec43949683544d0031b (patch)
treea88c2bcfb27103648413c8e62bbb35e64312248a /t/unit-tests/u-reftable-stack.c
parent178c5885007b83dd10cac1e09b72ef8d9fe2ac29 (diff)
reftable/stack: handle outdated stacks when compacting
When we compact the reftable stack we first acquire the lock for the "tables.list" file and then reload the stack to check that it is still up-to-date. This is done by calling `stack_uptodate()`, which knows to return zero in case the stack is up-to-date, a positive value if it is not and a negative error code on unexpected conditions. We don't do proper error checking though, but instead we only check whether the returned error code is non-zero. If so, we simply bubble it up the calling stack, which means that callers may see an unexpected positive value. Fix this issue by translating to `REFTABLE_OUTDATED_ERROR` instead. Handle this situation in `reftable_addition_commit()`, where we perform a best-effort auto-compaction. All other callsites of `stack_uptodate()` know to handle a positive return value and thus don't need to be fixed. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-reftable-stack.c')
0 files changed, 0 insertions, 0 deletions