git/reftable
Meet Soni 0e1b9c5eed reftable: adapt write_object_record() to propagate block_writer_add() errors
Previously, write_object_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 write_object_record() to inspect the error code returned by
block_writer_add() and flush and reinitialize the writer iff the
error is REFTABLE_ENTRY_TOO_BIG_ERROR. For any other error, immediately
propagate it.

If the flush and reinitialization still fail with
REFTABLE_ENTRY_TOO_BIG_ERROR, reset the record's offset length to zero
before a final attempt.

All call sites now handle various error codes returned by
block_writer_add().

Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-03-21 01:51:08 -07:00
..
LICENSE
basics.c reftable/basics: adjust `hash_size()` to return `uint32_t` 2025-01-21 14:20:29 -08:00
basics.h reftable/basics: adjust `hash_size()` to return `uint32_t` 2025-01-21 14:20:29 -08:00
block.c reftable: propagate specific error codes in block_writer_add() 2025-03-21 01:51:07 -07:00
block.h reftable: propagate specific error codes in block_writer_add() 2025-03-21 01:51:07 -07:00
blocksource.c reftable/blocksource: adjust `read_block()` to return `ssize_t` 2025-01-21 14:20:30 -08:00
blocksource.h reftable/blocksource: adapt interface name 2024-10-17 16:59:56 -04:00
constants.h
error.c reftable/error: introduce out-of-memory error code 2024-10-02 07:53:50 -07:00
iter.c reftable: handle trivial `reftable_buf` errors 2024-10-17 16:59:56 -04:00
iter.h reftable: convert from `strbuf` to `reftable_buf` 2024-10-17 16:59:56 -04:00
merged.c Merge branch 'ps/reftable-alloc-failures-zalloc-fix' 2024-12-23 09:32:06 -08:00
merged.h reftable/system: stop depending on "hash.h" 2024-11-19 12:23:10 +09:00
pq.c reftable: avoid leaks on realloc error 2024-12-28 08:00:44 -08:00
pq.h reftable/pq: handle allocation failures when adding entries 2024-10-02 07:53:55 -07:00
reader.c reftable: release name on reftable_reader_new() error 2025-03-04 09:21:39 -08:00
reader.h reftable/blocksource: adjust `read_block()` to return `ssize_t` 2025-01-21 14:20:30 -08:00
record.c reftable: propagate specific error codes in block_writer_add() 2025-03-21 01:51:07 -07:00
record.h reftable/basics: adjust `hash_size()` to return `uint32_t` 2025-01-21 14:20:29 -08:00
reftable-basics.h reftable/system: stop depending on "hash.h" 2024-11-19 12:23:10 +09:00
reftable-blocksource.h reftable/blocksource: adjust `read_block()` to return `ssize_t` 2025-01-21 14:20:30 -08:00
reftable-error.h reftable: prevent 'update_index' changes after adding records 2025-01-22 09:51:36 -08:00
reftable-iterator.h
reftable-merged.h reftable/system: stop depending on "hash.h" 2024-11-19 12:23:10 +09:00
reftable-reader.h reftable/system: stop depending on "hash.h" 2024-11-19 12:23:10 +09:00
reftable-record.h reftable/basics: adjust `hash_size()` to return `uint32_t` 2025-01-21 14:20:29 -08:00
reftable-stack.h reftable/stack: add accessor for the hash ID 2024-11-26 17:18:36 +09:00
reftable-writer.h Merge branch 'kn/reflog-migration-fix-followup' 2025-02-14 17:53:48 -08:00
stack.c Merge branch 'kn/reflog-migration-fix-followup' 2025-02-14 17:53:48 -08:00
stack.h
system.c reftable/system: provide thin wrapper for lockfile subsystem 2024-11-19 12:23:11 +09:00
system.h Merge branch 'ps/zlib-ng' 2025-02-06 14:56:45 -08:00
tree.c reftable/tree: handle allocation failures 2024-10-02 07:53:55 -07:00
tree.h reftable/tree: handle allocation failures 2024-10-02 07:53:55 -07:00
writer.c reftable: adapt write_object_record() to propagate block_writer_add() errors 2025-03-21 01:51:08 -07:00
writer.h reftable: rename scratch buffer 2024-11-26 08:39:38 +09:00