This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch cassandra-6.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 41e0c8c96b368955d2efddf986fc767558e76af0
Merge: 6e0549d53c 7ee239aac9
Author: Caleb Rackliffe <[email protected]>
AuthorDate: Wed Sep 2 16:53:06 2026 -0500

    Merge branch 'cassandra-5.0' into cassandra-6.0
    
    * cassandra-5.0:
      Unwrap LongType properly when calculating min/max terms in V1SSTableIndex

 CHANGES.txt                                        |  1 +
 .../index/sai/disk/v1/V1SSTableIndex.java          |  4 +--
 .../cassandra/index/sai/utils/IndexTermType.java   | 10 ------
 .../index/sai/cql/ClusteringKeyIndexTest.java      | 36 ++++++++++++++++++++++
 4 files changed, 39 insertions(+), 12 deletions(-)

diff --cc CHANGES.txt
index fb13a5cf7f,800547a91b..52a35e8fc8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,5 +1,25 @@@
 -5.0.10
 +6.0-alpha3
 + * Encode the CQL as raw bytes to avoid utf string serialization length 
limitation (CASSANDRA-21599)
 + * Add a guardrail to disallow reconfiguring CMS below a minimum size 
(CASSANDRA-19195)
 + * Node can report DECOMMISSION_FAILED while actively leaving after a 
rejected decommission attempt (CASSANDRA-21583)
 + * Make NoSpamLogger to use Caffeine cache instead of unbounded cache that 
could lead to memory exhaustion (CASSANDRA-21474)
 + * Reduce overheads of isOrdinaryUser check performed by Guardrail.enabled 
(CASSANDRA-21589)
 + * MultiStepOperations should not encode range movements using endpoints 
(CASSANDRA-21582)
 + * Avoid "During operation execution,... at ONE the ring has changed from 
epoch1 to epoch2 error" with counter writes (CASSANDRA-21585)
 + * Reject LIKE patterns with a wildcard (%) anywhere other than the start or 
end (CASSANDRA-21068)
 + * Stabilize cursor-based compaction (CASSANDRA-21462)
 + * Stop using Java streams in CIDRPermissions.SubsetPermissions#canAccessFrom 
hot method (CASSANDRA-21588)
 + * Enable trickle fsync by default (CASSANDRA-21572)
 + * Protect uncaught_exceptions virtual table against the crash path 
(CASSANDRA-21578)
 + * Optimize ServerConnection.requests for both reads and writes 
(CASSANDRA-21569)
 + * Ensure transferred_ranges reset on decommision re-attempt when pending 
ranges cannot be proven continous (CASSANDRA-16290)
 + * Add blob type support to SAI (CASSANDRA-20012)
 + * Fix deserialization of column masks in cluster metadata (CASSANDRA-21549)
 + * Caffeine caches in CompressionDictionaryCache and ZstdDictionaryCompressor 
should specify an executor explicitly (CASSANDRA-21557)
 + * Make cqlsh prompt to reset to no keyspace set by USE after dropping that 
keyspace (CASSANDRA-21548)
 + * Implement CMS rediscovery and recovery protocol (CASSANDRA-20476)
 +Merged from 5.0:
+  * Unwrap LongType properly when calculating min/max terms in V1SSTableIndex 
(CASSANDRA-21635)
   * Force repair should ignore min_repair_interval (CASSANDRA-21552)
   * Render SubnetGroups as JSON in system_views.settings (CASSANDRA-21579)
   * Avoid rebuilding per-SSTable SAI components unless missing or corrupted 
(CASSANDRA-21515)
diff --cc src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java
index 79b1d10760,eeb7cdd1d2..c7318d9835
--- a/src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java
+++ b/src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java
@@@ -471,85 -452,6 +470,76 @@@ public class IndexTermTyp
          }
      }
  
 +    @Nullable
 +    public Iterator<ByteBuffer> valuesOfFrozenCollection(Row row, long 
nowInSecs)
 +    {
 +        if (row == null)
 +            return null;
 +
 +        ByteBuffer buffer;
 +
 +        if (columnMetadata.kind == ColumnMetadata.Kind.CLUSTERING)
 +             buffer = row.clustering().bufferAt(columnMetadata.position());
 +        else
 +        {
 +            Cell<?> cell = row.getCell(columnMetadata);
 +            if (cell == null || !cell.isLive(nowInSecs))
 +                return null;
 +            buffer = cell.buffer();
 +        }
 +
 +        if (buffer == null || buffer.remaining() == 0)
 +            return null;
 +
 +        CollectionType<?> collectionType = (CollectionType<?>) 
columnMetadata.type.unwrap();
 +        List<ByteBuffer> elements = collectionType.unpack(buffer);
 +
 +        switch (collectionType.kind)
 +        {
 +            case LIST:
 +            case SET:
 +                break;
 +            case MAP:
 +                elements = extractMapElements(elements);
 +                break;
 +            default:
 +                throw new IllegalArgumentException("Unsupported type of 
collection - " + collectionType.kind);
 +        }
 +
 +        if (isInetAddress())
 +            elements.sort((c1, c2) -> compareInet(encodeInetAddress(c1), 
encodeInetAddress(c2)));
 +
 +        return elements.iterator();
 +    }
 +
 +    private List<ByteBuffer> extractMapElements(List<ByteBuffer> elements)
 +    {
 +        List<ByteBuffer> result = new ArrayList<>(elements.size());
 +
 +        for (int i = 0; i < elements.size(); i += 2)
 +        {
 +            ByteBuffer key = elements.get(i);
 +            ByteBuffer value = i + 1 < elements.size() ? elements.get(i + 1) 
: null;
 +
 +            switch (indexTargetType)
 +            {
 +                case KEYS:
 +                    result.add(key);
 +                    break;
 +                case VALUES:
 +                    if (value != null)
 +                        result.add(value);
 +                    break;
 +                case KEYS_AND_VALUES:
 +                    if (value != null)
 +                        
result.add(CompositeType.build(ByteBufferAccessor.instance, key, value));
 +                    break;
 +            }
 +        }
 +
 +        return result;
 +    }
 +
-     public Comparator<ByteBuffer> comparator()
-     {
-         // Override the comparator for BigInteger, BigDecimal and composite 
types
-         if (isBigInteger() || isBigDecimal() || isComposite())
-             return FastByteOperations::compareUnsigned;
- 
-         return indexType;
-     }
- 
      /**
       * Compare two terms based on their type. This is used in place of {@link 
AbstractType#compare(ByteBuffer, ByteBuffer)}
       * so that the default comparison can be overridden for specific types.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to