Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6d5e859
initial
alanwang67 Feb 23, 2026
3241b64
formatting
alanwang67 Feb 23, 2026
53149bb
inlined loop
alanwang67 Feb 23, 2026
97b0e97
null check
alanwang67 Feb 24, 2026
2663505
inline
alanwang67 Feb 24, 2026
1d2dd27
fix
alanwang67 Feb 24, 2026
2fba86e
update
alanwang67 Feb 24, 2026
3538f16
fix npe
alanwang67 Feb 24, 2026
a7bb9ff
fix wrong use of overlapping
alanwang67 Feb 24, 2026
226ddd0
use shard index instead of command store id
alanwang67 Feb 25, 2026
aa61f85
refactor
alanwang67 Feb 26, 2026
4b5b2a9
added method for greatest epoch and range that needs to be retired
alanwang67 Feb 26, 2026
356c173
fix class name
alanwang67 Feb 27, 2026
c5962ad
fix
alanwang67 Feb 27, 2026
8dbd41d
factor out method to test
alanwang67 Feb 27, 2026
8d930b7
refactor to test
alanwang67 Feb 27, 2026
a06d79e
fix bug
alanwang67 Feb 27, 2026
78fe590
Refined check for querying > 1 command store for same range
alanwang67 Mar 3, 2026
00e9136
null check
alanwang67 Mar 3, 2026
c72e9b2
fix
alanwang67 Mar 3, 2026
6873064
name changes
alanwang67 Mar 4, 2026
3c710de
change failure mode
alanwang67 Mar 4, 2026
d5db5f5
changed error handling
alanwang67 Mar 5, 2026
fb12db9
change casing
alanwang67 Mar 9, 2026
f4be3a7
initial
alanwang67 Mar 11, 2026
f378655
fix
alanwang67 Mar 11, 2026
2583d63
fix
alanwang67 Mar 11, 2026
986c7f8
fixes
alanwang67 Mar 11, 2026
77d35e6
fix
alanwang67 Mar 11, 2026
e6768bb
feedback/edits for regaining ranges
belliottsmith Apr 17, 2026
b93f5ad
fixed indexing bug
alanwang67 Apr 20, 2026
4673322
delete command stores:
alanwang67 Apr 22, 2026
af8a2e3
fix NPE
alanwang67 Apr 24, 2026
3fb4f51
suggestions
belliottsmith Apr 27, 2026
9e32dc3
fix
alanwang67 Apr 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions accord-core/src/main/java/accord/api/Journal.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import accord.impl.CommandChange;
import accord.local.Command;
import accord.local.CommandStores;
import accord.local.CommandStores.PreviouslyOwned;
import accord.local.DurableBefore;
import accord.local.Node;
import accord.local.RedundantBefore;
Expand Down Expand Up @@ -85,11 +86,13 @@ class TopologyUpdate
{
public final Int2ObjectHashMap<CommandStores.RangesForEpoch> commandStores;
public final Topology global;
public final PreviouslyOwned previouslyOwned;

public TopologyUpdate(@Nonnull Int2ObjectHashMap<CommandStores.RangesForEpoch> commandStores, @Nonnull Topology global)
public TopologyUpdate(@Nonnull Int2ObjectHashMap<CommandStores.RangesForEpoch> commandStores, @Nonnull Topology global, PreviouslyOwned previouslyOwned)
{
this.commandStores = commandStores;
this.global = global;
this.previouslyOwned = previouslyOwned;
}

public boolean isEquivalent(TopologyUpdate other)
Expand All @@ -103,7 +106,7 @@ public boolean isEquivalent(TopologyUpdate other)

public TopologyUpdate cloneWithEquivalentEpoch(long epoch)
{
return new TopologyUpdate(commandStores, global.cloneEquivalentWithEpoch(epoch));
return new TopologyUpdate(commandStores, global.cloneEquivalentWithEpoch(epoch), previouslyOwned);
}

@Override
Expand Down Expand Up @@ -150,6 +153,7 @@ class FieldUpdates
public RedundantBefore newRedundantBefore;
public NavigableMap<TxnId, Ranges> newBootstrapBeganAt;
public NavigableMap<Timestamp, Ranges> newSafeToRead;
public Ranges newPermanentlyUnsafeToRead;
public CommandStores.RangesForEpoch newRangesForEpoch;

public String toString()
Expand All @@ -161,6 +165,8 @@ public String toString()
builder.append("newBootstrapBeganAt=").append(newBootstrapBeganAt).append(", ");
if (newSafeToRead != null)
builder.append("newSafeToRead=").append(newSafeToRead).append(", ");
if (newPermanentlyUnsafeToRead != null)
builder.append("newPermanentlyUnsafeToRead=").append(newPermanentlyUnsafeToRead).append(", ");
if (newRangesForEpoch != null)
builder.append("newRangesForEpoch=").append(newRangesForEpoch).append(", ");
builder.setLength(builder.length() - 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class MaybeRecover extends CheckShards<Outcome, Route<?>>
this.recoverIfAlreadyDurable = recoverIfAlreadyDurable;
this.reportTo = reportTo;
}

public static Object maybeRecover(Node node, TxnId txnId, Infer.InvalidIf invalidIf, Route<?> someRoute, ProgressToken prevProgress, boolean recoverIfAlreadyDurable, LatentStoreSelector reportTo, BiConsumer<? super Outcome, Throwable> callback)
{
MaybeRecover maybeRecover;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public final void setSafeToRead(NavigableMap<Timestamp, Ranges> newSafeToRead)
ensureFieldUpdates().newSafeToRead = newSafeToRead;
}

@Override
public final void setPermanentlyUnsafeToRead(Ranges newPermanentlyUnsafeToRead)
{
ensureFieldUpdates().newPermanentlyUnsafeToRead = newPermanentlyUnsafeToRead;
}

@Override
public void setRangesForEpoch(RangesForEpoch rangesForEpoch)
{
Expand Down
20 changes: 18 additions & 2 deletions accord-core/src/main/java/accord/local/CommandStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ CommandStore create(int id,
* But they may still be ordered for other key ranges they participate in.
*/
private NavigableMap<Timestamp, Ranges> safeToRead = emptySafeToRead();
private Ranges permanentlyUnsafeToRead = Ranges.EMPTY;
private final Set<Bootstrap> bootstraps = Collections.synchronizedSet(new DeterministicIdentitySet<>());
@Nullable private RejectBefore rejectBefore;

Expand Down Expand Up @@ -399,10 +400,17 @@ protected void unsafeAcceptRequests(Ranges accept)
/**
* This method may be invoked on a non-CommandStore thread
*/
final void unsafeSetSafeToRead(NavigableMap<Timestamp, Ranges> newSafeToRead)
final void unsafeSetSafeToRead(@Nullable NavigableMap<Timestamp, Ranges> newSafeToRead)
{
if (newSafeToRead != null)
newSafeToRead = purgeHistory(newSafeToRead, permanentlyUnsafeToRead);
safeToRead = newSafeToRead;
node.updateStamp();
this.safeToRead = newSafeToRead;
}

final void unsafeSetPermanentlyUnsafeToRead(Ranges newPermanentlyUnsafeToRead)
{
this.permanentlyUnsafeToRead = newPermanentlyUnsafeToRead;
}

protected final void unsafeClearSafeToRead()
Expand Down Expand Up @@ -1181,6 +1189,14 @@ final void markUnsafeToRead(Ranges ranges)
}
}

final AsyncChain<Void> markPermanentlyUnsafeToRead(Ranges ranges)
{
return chain((Empty) () -> "Mark Range As Permanently Unsafe To Read", safeStore -> {
safeStore.setSafeToRead(purgeHistory(safeToRead, ranges));
safeStore.setPermanentlyUnsafeToRead(permanentlyUnsafeToRead.union(MERGE_ADJACENT, ranges));
});
}

public final DataStore unsafeGetDataStore()
{
return dataStore;
Expand Down
Loading