summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-03-01 12:17:54 +0100
committerHan-Wen Nienhuys <hanwen@google.com>2021-03-01 12:17:54 +0100
commit540b29bf4266f3ec974cdf230faca32ab712843b (patch)
tree45f5f176a9fc6a7e800503ce22cb440e4f6802ed /org.eclipse.jgit/src
parentf621c31f4ca35a440535bf9e98382eae8a1f4643 (diff)
downloadjgit-540b29bf4266f3ec974cdf230faca32ab712843b.tar.gz
jgit-540b29bf4266f3ec974cdf230faca32ab712843b.zip
Remove ReftableNumbersNotIncreasingException
In a distributed setting, one can have multiple datacenters use reftables for serving, while the ground truth for the Ref database is administered centrally. In this setting, replication delays combined with compaction can cause update-index ranges to overlap. Such a setting is used at Google, and the JGit code already handles this correctly (modulo a bugfix that applied in change I8f8215b99a). Remove the restriction that was applied at FileReftableDatabase. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I6f9ed0fbd7fbc5220083ab808b22a909215f13a9
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java37
1 files changed, 0 insertions, 37 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
index bc2039c56b..71130f0f3b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
@@ -128,33 +128,6 @@ public class FileReftableStack implements AutoCloseable {
return stats;
}
- /** Thrown if the update indices in the stack are not monotonic */
- public static class ReftableNumbersNotIncreasingException
- extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- String name;
-
- long lastMax;
-
- long min;
-
- ReftableNumbersNotIncreasingException(String name, long lastMax,
- long min) {
- this.name = name;
- this.lastMax = lastMax;
- this.min = min;
- }
-
- @SuppressWarnings({ "nls", "boxing" })
- @Override
- public String toString() {
- return String.format(
- "ReftableNumbersNotIncreasingException %s: min %d, lastMax %d",
- name, min, lastMax);
- }
- }
-
/**
* Reloads the stack, potentially reusing opened reftableReaders.
*
@@ -173,7 +146,6 @@ public class FileReftableStack implements AutoCloseable {
List<ReftableReader> newTables = new ArrayList<>();
List<StackEntry> newStack = new ArrayList<>(stack.size() + 1);
try {
- ReftableReader last = null;
for (String name : names) {
StackEntry entry = new StackEntry();
entry.name = name;
@@ -191,15 +163,6 @@ public class FileReftableStack implements AutoCloseable {
newTables.add(t);
}
- if (last != null) {
- // TODO: move this to MergedReftable
- if (last.maxUpdateIndex() >= t.minUpdateIndex()) {
- throw new ReftableNumbersNotIncreasingException(name,
- last.maxUpdateIndex(), t.minUpdateIndex());
- }
- }
- last = t;
-
entry.reftableReader = t;
newStack.add(entry);
}