]> git.ipfire.org Git - thirdparty/git.git/commit
reftable: adapt writer_add_record() to propagate block_writer_add() errors
authorMeet Soni <meetsoni3017@gmail.com>
Wed, 19 Mar 2025 15:29:26 +0000 (20:59 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Mar 2025 08:51:07 +0000 (01:51 -0700)
commit9ce297239b94ca6bc671b629246711d0ebf096ef
treedc3f6922fc10f97cedce765b3ce012c04f001f28
parent27571684ddca217d65c5f39947f20b9f5ec91863
reftable: adapt writer_add_record() to propagate block_writer_add() errors

Previously, writer_add_record() would flush the current block and retry
appending the record whenever block_writer_add() returned any nonzero
error. This forced an assumption that every failure meant the block was
full, even when errors such as memory allocation or I/O failures occurred.

Update the writer_add_record() to inspect the error code returned by
block_writer_add() and only flush and reinitialize the writer when the
error is REFTABLE_ENTRY_TOO_BIG_ERROR. For any other error, immediately
propagate it.

Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/writer.c