maedhroz commented on code in PR #4428:
URL: https://github.com/apache/cassandra/pull/4428#discussion_r2535178906
##########
src/java/org/apache/cassandra/db/lifecycle/Tracker.java:
##########
@@ -270,6 +272,20 @@ public void
updateInitialSSTableSize(Iterable<SSTableReader> sstables)
public void addSSTables(Collection<SSTableReader> sstables)
{
+
Preconditions.checkState(!cfstore.metadata().replicationType().isTracked());
+ addSSTablesInternal(sstables, false, true, true);
+ }
+
+ public void addSSTablesTracked(Collection<SSTableReader> sstables)
+ {
+
Preconditions.checkState(cfstore.metadata().replicationType().isTracked());
+ for (SSTableReader sstable : sstables)
+ {
+ ImmutableCoordinatorLogOffsets logOffsets =
sstable.getCoordinatorLogOffsets();
+ Preconditions.checkState(logOffsets.mutations().isEmpty());
+ Preconditions.checkState(!logOffsets.transfers().isEmpty());
Review Comment:
Couple thoughts:
1.) Would `ImmutableCoordinatorLogOffsets` benefit from a method like
`isTransfer()` that we could use here? ^
2.) I'd consider actual error messages here (especially after collapsing the
two checks above with `isTransfer()`), although if we used assertions
correctly, those would be better (given this is a programmer error if it
happens).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]