Merge branch 'cassandra-4.0' into cassandra-4.1

This commit is contained in:
Stefan Miklosovic 2025-01-18 11:38:56 +01:00
commit 4f4c5542fe
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
3 changed files with 21 additions and 2 deletions

View File

@ -5,6 +5,7 @@
* Equality check for Paxos.Electorate should not depend on collection types (CASSANDRA-19935)
* Fix race condition in DecayingEstimatedHistogramReservoir during rescale (CASSANDRA-19365)
Merged from 4.0:
* Do not attach rows and partitions to CheckForAbort when already attached (CASSANDRA-20135)
* Allow hint delivery during schema mismatch (CASSANDRA-20188)
* IndexOutOfBoundsException when accessing partition where the column was deleted (CASSANDRA-20108)
* Enhance CQLSSTableWriter to notify clients on sstable production (CASSANDRA-19800)

View File

@ -36,6 +36,8 @@ import org.slf4j.LoggerFactory;
import io.netty.util.concurrent.FastThreadLocal;
import org.apache.cassandra.config.*;
import org.apache.cassandra.db.filter.*;
import org.apache.cassandra.db.transform.BasePartitions;
import org.apache.cassandra.db.transform.BaseRows;
import org.apache.cassandra.net.MessageFlag;
import org.apache.cassandra.net.ParamType;
import org.apache.cassandra.net.Verb;
@ -616,6 +618,22 @@ public abstract class ReadCommand extends AbstractReadQuery
{
long lastChecked = 0;
@Override
protected void attachTo(BasePartitions partitions)
{
Preconditions.checkArgument(this.partitions == null || this.partitions == partitions,
"Attempted to attach 2nd different BasePartitions in StoppingTransformation; this is a bug.");
this.partitions = partitions;
}
@Override
protected void attachTo(BaseRows rows)
{
Preconditions.checkArgument(this.rows == null || this.rows == rows,
"Attempted to attach 2nd different BaseRows in StoppingTransformation; this is a bug.");
this.rows = rows;
}
protected UnfilteredRowIterator applyToPartition(UnfilteredRowIterator partition)
{
if (maybeAbort())

View File

@ -26,8 +26,8 @@ import org.apache.cassandra.db.rows.BaseRowIterator;
// A Transformation that can stop an iterator earlier than its natural exhaustion
public abstract class StoppingTransformation<I extends BaseRowIterator<?>> extends Transformation<I>
{
private BaseIterator rows;
private BaseIterator partitions;
protected BaseIterator rows;
protected BaseIterator partitions;
/**
* If invoked by a subclass, any partitions iterator this transformation has been applied to will terminate