Hi, yesterday I noticed that writing reftables with more than 250,000 refs led to the last block of refs in the table not being seekable anymore. As it turns out, 250k refs was the boundary at which we start to write multi-level indices for refs. The root cause is a bug with how we write multi-level indices: we did not flush out the last block of the previous index level, and thus we didn't index it in the higher-level index. This patch series fixes this issue and also polishes surrounding code a bit. The topic depends on Junio's jc/reftable-core-fsync at 1df18a1c9a (reftable: honor core.fsync, 2024-01-23) due to a semantic merge conflict in the newly added test. Patrick Patrick Steinhardt (5): reftable/reader: be more careful about errors in indexed seeks reftable/writer: use correct type to iterate through index entries reftable/writer: simplify writing index records reftable/writer: fix writing multi-level indices reftable: document reading and writing indices reftable/reader.c | 30 ++++++++++++++++++ reftable/readwrite_test.c | 56 ++++++++++++++++++++++++++++++++++ reftable/writer.c | 64 ++++++++++++++++++++++----------------- 3 files changed, 123 insertions(+), 27 deletions(-) -- 2.43.GIT
Attachment:
signature.asc
Description: PGP signature