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> |
||
|---|---|---|
| .. | ||
| LICENSE | ||
| basics.c | ||
| basics.h | ||
| block.c | ||
| block.h | ||
| blocksource.c | ||
| blocksource.h | ||
| constants.h | ||
| error.c | ||
| iter.c | ||
| iter.h | ||
| merged.c | ||
| merged.h | ||
| pq.c | ||
| pq.h | ||
| reader.c | ||
| reader.h | ||
| record.c | ||
| record.h | ||
| reftable-basics.h | ||
| reftable-blocksource.h | ||
| reftable-error.h | ||
| reftable-iterator.h | ||
| reftable-merged.h | ||
| reftable-reader.h | ||
| reftable-record.h | ||
| reftable-stack.h | ||
| reftable-writer.h | ||
| stack.c | ||
| stack.h | ||
| system.c | ||
| system.h | ||
| tree.c | ||
| tree.h | ||
| writer.c | ||
| writer.h | ||