Fix AbstractKeys.without (and CoordinateEphemeralRead execution in future epoch)

patch by Benedict; reviewed by David Capwell for CASSANDRA-20095
This commit is contained in:
Benedict Elliott Smith 2024-11-12 13:04:15 +00:00 committed by David Capwell
parent 304749ebda
commit 03cd31fc57
2 changed files with 8 additions and 5 deletions

@ -1 +1 @@
Subproject commit a8f78552b958a9d9b6fc9f2840753001cd1f6004
Subproject commit ad6d9c748984d64518377510434e59923b7c3183

View File

@ -46,6 +46,8 @@ import accord.local.SafeCommandStore;
import accord.local.cfk.CommandsForKey;
import accord.primitives.AbstractKeys;
import accord.primitives.AbstractRanges;
import accord.primitives.AbstractUnseekableKeys;
import accord.primitives.Participants;
import accord.primitives.Ranges;
import accord.primitives.Routable;
import accord.primitives.Routables;
@ -119,13 +121,13 @@ public class AccordSafeCommandStore extends SafeCommandStore
return context;
List<RoutingKey> unavailable = null;
Unseekables<?> keys = context.keys();
AbstractUnseekableKeys keys = (AbstractUnseekableKeys) context.keys();
if (keys.size() == 0)
return context;
for (int i = 0 ; i < keys.size() ; ++i)
{
RoutingKey key = (RoutingKey) keys.get(i);
RoutingKey key = keys.get(i);
if (keyHistory == TIMESTAMPS)
{
if (null != timestampsForKeyInternal(key))
@ -161,7 +163,8 @@ public class AccordSafeCommandStore extends SafeCommandStore
if (unavailable.size() == keys.size())
return null;
return PreLoadContext.contextFor(context.primaryTxnId(), context.additionalTxnId(), keys.without(RoutingKeys.ofSortedUnique(unavailable)), keyHistory);
Participants<RoutingKey> available = keys.without(RoutingKeys.ofSortedUnique(unavailable));
return PreLoadContext.contextFor(context.primaryTxnId(), context.additionalTxnId(), available, keyHistory);
}
}
@ -524,4 +527,4 @@ public class AccordSafeCommandStore extends SafeCommandStore
public NavigableMap<Timestamp, Ranges> newSafeToRead;
public RangesForEpoch.Snapshot newRangesForEpoch;
}
}
}