]> source.dussan.org Git - jgit.git/commit
reftable: explicitly store update_index per ref 31/103331/2
authorShawn Pearce <spearce@spearce.org>
Sat, 19 Aug 2017 18:28:34 +0000 (11:28 -0700)
committerShawn Pearce <spearce@spearce.org>
Mon, 21 Aug 2017 22:39:08 +0000 (15:39 -0700)
commit44a75d9ea8a549d5eb3ab155bcca530b4e0ad595
tree22eee76678ddc53816c4d0585cb29200c8ae3d12
parent231f5d9baf8502e581605c645b4a11bbc904a314
reftable: explicitly store update_index per ref

Add an update_index to every reference in a reftable, storing the
exact transaction that last modified the reference.  This is necessary
to fix some merge race conditions.

Consider updates at T1, T3 are present in two reftables.  Compacting
these will create a table with range [T1,T3].  If T2 arrives during
or after the compaction its impossible for readers to know how to
merge the [T1,T3] table with the T2 table.

With an explicit update_index per reference, MergedReftable is able to
individually sort each reference, merging individual entries at T3
from [T1,T3] ahead of identically named entries appearing in T2.

Change-Id: Ie4065d4176a5a0207dcab9696ae05d086e042140
Documentation/technical/reftable.md
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/MergedReftableTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/ReftableTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/BlockReader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/BlockWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/MergedReftable.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/RefCursor.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableCompactor.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableWriter.java