Re: [PATCH v2 0/4] loose: fix migrating "loose-object-idx" with batch fsync
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2026, 22:22 UTC
- Message-ID
- <xmqq8q3gywny.fsf@gitster.g>
- In-Reply-To
- <20261029002413.3291184-1-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 29 quoted lines
> Greetings, > > While working on a separate patch series to convert the "files" ODB > transaction to be eagerly created instead of lazily, I encountered this > bug that causes an ODB transaction to fail on commit when a > compatibility hash is also configured. This occurs because the temporary > directory migration code does not know how to handle the loose object > index file. > > This patch addresses updating the migration logic to explicitly merge > mapping entries in the transaction and atomically write a new > "loose-object-idx" file. > > Some other approaches I considered: > - Storing the uncommitted object mapping entries in the transaction > without writing a file and only writing on transaction commit. I > chose to keep writing the temp index into the transaction so that > child processes that write to the tempdir could still append entries. > - Also writing mapping entires to the main ODB loose object index. > This also didn't seem like a good apprach because it write entries > that may not ultimately get committed. > > Changes since V1: > - The loose object index write after the merging maps is now atomic. > - Added a fixed timeout to all loose object index writers. > - Duplicate entries are now dropped when writing the merged mapping file. > > Thanks for the review, > -Justin
Thanks.
Merging this topic to 'seen' had a funny interaction with other topics in flight. repo_write_loose_object_map() function, from which loose_object_map_write() helper function was extracted out of, loses all callers, and will disappear in the merge. But the new helper, which gained a caller loose_object_idx_merge() in this series, remains.