Skip to content

Commit 001accf

Browse files
committed
Merge branch 'cassandra-5.0' into trunk
2 parents 02352b7 + edf6034 commit 001accf

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Merged from 5.0:
1414
Merged from 4.1:
1515
* Harden data resurrection startup check with atomic heartbeat file write with fallback (CASSANDRA-21290)
1616
Merged from 4.0:
17+
* Backport CASSANDRA-17810 fix and improve RTBoundValidator error messages (CASSANDRA-18282)
1718
* Rate limit password changes (CASSANDRA-21202)
1819

1920

src/java/org/apache/cassandra/db/ReadCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ private UnfilteredPartitionIterator withQueryCancellation(UnfilteredPartitionIte
894894
/**
895895
* A transformation used for simulating slow queries by tests.
896896
*/
897+
@VisibleForTesting
897898
private static class DelayInjector extends Transformation<UnfilteredRowIterator>
898899
{
899900
@Override

src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
package org.apache.cassandra.db;
1919

20+
import com.google.common.base.Preconditions;
21+
2022
import org.slf4j.Logger;
2123
import org.slf4j.LoggerFactory;
2224

@@ -116,7 +118,7 @@ public void doVerb(Message<ReadCommand> message)
116118
{
117119
logger.debug("Query cancelled (timeout)", e);
118120
response = null;
119-
assert !command.isCompleted() : "Read marked as completed despite being aborted by timeout to table " + command.metadata();
121+
Preconditions.checkState(!command.isCompleted(), "Read marked as completed despite being aborted by timeout to table %s", command.metadata());
120122
}
121123

122124
if (command.complete())

src/java/org/apache/cassandra/db/transform/RTBoundValidator.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import org.apache.cassandra.db.rows.UnfilteredRowIterator;
2626

2727
/**
28-
* A validating transformation that sanity-checks the sequence of RT bounds and boundaries in every partition.
28+
* A validating transformation that sanity-checks the sequence of Range Tombstone bounds and boundaries in every
29+
* partition.
2930
*
3031
* What we validate, specifically:
3132
* - that open markers are only followed by close markers
@@ -109,7 +110,7 @@ public RangeTombstoneMarker applyToMarker(RangeTombstoneMarker marker)
109110
public void onPartitionClose()
110111
{
111112
if (enforceIsClosed && null != openMarkerDeletionTime)
112-
throw ise("expected all RTs to be closed, but the last one is open");
113+
throw ise("expected all Range Tombstones to be closed, but the last one is open");
113114
}
114115

115116
private IllegalStateException ise(String why)
@@ -119,7 +120,7 @@ private IllegalStateException ise(String why)
119120

120121
private String message(String why)
121122
{
122-
return String.format("%s UnfilteredRowIterator for %s (key: %s omdt: [%s]) has an illegal RT bounds sequence: %s",
123+
return String.format("%s UnfilteredRowIterator for %s (key: %s omdt: [%s]) has an illegal Range Tombstone bounds sequence: %s",
123124
stage,
124125
partition.metadata(),
125126
partition.metadata().partitionKeyType.getString(partition.partitionKey().getKey()),

src/java/org/apache/cassandra/service/StorageProxy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import javax.annotation.Nonnull;
4646
import javax.annotation.Nullable;
4747

48+
import com.google.common.base.Preconditions;
4849
import com.google.common.cache.CacheLoader;
4950
import com.google.common.collect.ImmutableList;
5051
import com.google.common.collect.ImmutableSet;
@@ -2761,7 +2762,7 @@ protected void runMayThrow()
27612762
{
27622763
logger.debug("Query cancelled (timeout)", e);
27632764
response = null;
2764-
assert !command.isCompleted() : "Local read marked as completed despite being aborted by timeout to table " + command.metadata();
2765+
Preconditions.checkState(!command.isCompleted(), "Local read marked as completed despite being aborted by timeout to table %s", command.metadata());
27652766
}
27662767

27672768
if (command.complete())

0 commit comments

Comments
 (0)