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

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

commit e27ee64f7f3fa27e867571c311f5110e53160f08
Merge: b15526b481 b45f90cec4
Author: Caleb Rackliffe <[email protected]>
AuthorDate: Tue Oct 6 12:21:48 2026 -0500

    Merge branch 'cassandra-6.0' into trunk
    
    * cassandra-6.0:
      Sharding support for non-vector SAI in-memory indexes

 CHANGES.txt                                        |   1 +
 NEWS.txt                                           |   2 +
 .../developing/cql/indexing/sai/_sai-create.adoc   |   1 +
 .../pages/reference/cql-commands/create-index.adoc |   8 +-
 .../cassandra/db/memtable/ShardBoundaries.java     |  58 +++-
 src/java/org/apache/cassandra/dht/Range.java       |  16 +-
 .../index/accord/RouteMemtableIndexManager.java    |   9 +-
 .../cassandra/index/sai/StorageAttachedIndex.java  |  50 +++-
 .../cassandra/index/sai/disk/RowMapping.java       |  12 +-
 .../index/sai/disk/v1/MemtableIndexWriter.java     |   2 +-
 .../cassandra/index/sai/memory/MemtableIndex.java  | 103 +++----
 .../index/sai/memory/MemtableIndexManager.java     |  16 +-
 .../index/sai/memory/ShardedMemtableIndex.java     | 272 +++++++++++++++++++
 ...tableIndex.java => UnshardedMemtableIndex.java} |  38 ++-
 .../test/cql3/SingleNodeTableWalkTest.java         |  17 +-
 .../microbench/sai/AbstractMemtableIndexBench.java | 118 ++++++++
 .../microbench/sai/MemtableIndexFlushBench.java    | 150 +++++++++++
 .../sai/MemtableIndexPartitionReadBench.java       | 174 ++++++++++++
 .../microbench/sai/MemtableIndexReadBench.java     | 135 ++++++++++
 .../microbench/sai/MemtableIndexWriteBench.java    | 105 ++++++++
 .../cassandra/db/memtable/ShardBoundariesTest.java | 117 ++++++++
 .../cassandra/dht/RangeIntersectsBoundsTest.java   | 296 +++++++++++++++++++++
 .../index/sai/cql/StorageAttachedIndexDDLTest.java |  75 ++++++
 .../sai/memory/ShardedMemtableIndexFlushTest.java  |  55 ++++
 .../index/sai/memory/ShardedMemtableIndexTest.java | 255 ++++++++++++++++++
 .../index/sai/memory/TrieMemoryIndexTest.java      |  65 +----
 .../index/sai/utils/SAIRandomizedTester.java       |  69 +++++
 27 files changed, 2057 insertions(+), 162 deletions(-)

diff --cc CHANGES.txt
index 2db86747ef,015680a337..23777fae0d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,5 +1,18 @@@
 -6.0-alpha3
 +7.0
 + * Extract reusable HttpService from cloud metadata connector 
(CASSANDRA-21195)
 + * Redact hash and _hash suffixed parameters in system_views.settings 
(CASSANDRA-21686)
 + * Allow CQLSSTableWriter to specify SSTable id generator to use 
(CASSANDRA-21012)
 + * Reject LIKE patterns with a wildcard (%) anywhere other than the start or 
end (CASSANDRA-21068)
 + * Support pluggable default role initialization (CASSANDRA-21546)
 + * Add prepared statement cache stats to nodetool info (CASSANDRA-14366)
 + * Don't increment client metrics on messaging service connection unpause 
(CASSANDRA-21491)
 + * Add nodetool getreplicas (CASSANDRA-17665)
 + * Implementation of CEP-49: Hardware-accelerated compression 
(CASSANDRA-20975)
 + * Avoid using ObjectUtils.getFirstNonNull in Schema (CASSANDRA-21394)
 + * Allow nodetool garbagecollect to take a user defined list of SSTables 
(CASSANDRA-16767)
 + * Add a guardrail for misprepared statements (CASSANDRA-21139)
 +Merged from 6.0:
+  * Sharding support for non-vector SAI in-memory indexes (CASSANDRA-18216)
   * Index hints serialization rejects a count that the validation accepts 
(CASSANDRA-21700)
   * Do not expose system_metrics virtual keyspace by default (CASSANDRA-21720)
   * Tighten up NoSpamLogger changes after migration to Caffeine cache 
(CASSANDRA-21721)
diff --cc NEWS.txt
index 42fca7ad3d,af526ab092..581b1e3e6d
--- a/NEWS.txt
+++ b/NEWS.txt
@@@ -74,42 -74,6 +74,43 @@@ restore snapshots created with the prev
  'sstableloader' tool. You can upgrade the file format of your snapshots
  using the provided 'sstableupgrade' tool.
  
 +7.0
 +===
 +
 +New features
 +------------
 +
 +    - CEP-49 - it is possible to implement custom compression providers, e.g.
 +      integrating with a specialized hardware which makes de/compression 
faster.
 +      See CASSANDRA-20975 for more information.
 +    - It is now possible to bootstrap a cluster's initial superuser role 
without
 +      creating the 'cassandra/cassandra' password, by configuring 
'default_role_initializer'
 +      in cassandra.yaml. The new MutualTlsDefaultRoleInitializer creates the 
role
 +      passwordless and maps a client certificate identity onto it instead, for
 +      deployments that authenticate over mutual TLS. 
PasswordDefaultRoleInitializer
 +      remains the default and produces the historical behaviour. See 
CASSANDRA-21546
 +      for more information.
 +
 +Upgrading
 +---------
 +    - memtable_offheap_space: 0 is now rejected at startup when 
memtable_allocation_type is 
 +    offheap_buffers or offheap_objects. Set a positive 
memtable_offheap_space, or an allocation 
 +    type that does not allocate off-heap. See CASSANDRA-21019.
 +
 +    - trickle_fsync is by default set to "true" instead of "false" in 
cassandra.yaml (see CASSANDRA-21572)
 +    - Authorizing a batch or an Accord transaction now performs the table 
permission checks once per run of
 +      consecutive statements on the same table rather than once per 
statement. The permissions required are
 +      unchanged, and the datacenter and CIDR checks that ride along with them 
still run at least once per
 +      request. Auth cache request/hit/miss counts and the 
system_views.cidr_filtering_metrics_* counts and
 +      latencies will therefore report fewer events than before. (see 
CASSANDRA-21606)
 +    - The hostname column in system_views.clients will no longer perform a 
reverse DNS lookup and will instead
 +      return the same value as the address column. This avoids the risk of 
client connections overwhelming
 +      DNS. (CASSANDRA-21539)
++    - SAI Memtable-attached indexes are now split into 
`cassandra.memtable.shard.count` shards by default.
 +
 +Deprecation
 +-----------
 +
  
  6.0
  ===
@@@ -185,8 -149,12 +186,9 @@@ New feature
        cassandra.data_response_in_memory_max_rows_cl_one 
andcassandra.data_response_in_memory_max_size_cl_one.
        A limit is disabled by setting it to 0, and setting both limits of a 
tier to 0 disables the in-memory path for that tier.
        Note that the limits are not enforced in the middle of a range 
tombstone span, so a response may exceed them in that case.
+     - SAI Memtable-attached indexes now support sharding via WITH OPTIONS. 
See CQL documentation for details.
  Upgrading
  ---------
 -    - memtable_offheap_space: 0 is now rejected at startup when 
memtable_allocation_type is
 -    offheap_buffers or offheap_objects. Set a positive 
memtable_offheap_space, or an allocation
 -    type that does not allocate off-heap. See CASSANDRA-21019.
      [The following is a placeholder, to be revised asap]
      - trickle_fsync is by default set to "true" instead of "false" in 
cassandra.yaml (see CASSANDRA-21572)
      - Upgrading to 5.1 is currently only supported from 4.0, 4.1 or 5.0. 
Clusters running earlier releases must first
diff --cc 
doc/modules/cassandra/pages/developing/cql/indexing/sai/_sai-create.adoc
index 45e9362837,b5627c9065..9cb1d391c3
--- a/doc/modules/cassandra/pages/developing/cql/indexing/sai/_sai-create.adoc
+++ b/doc/modules/cassandra/pages/developing/cql/indexing/sai/_sai-create.adoc
@@@ -17,6 -17,7 +17,7 @@@ The SAI index options are defined in th
  The `case_sensitive` option is set to `false` to allow case-insensitive 
searches.
  The `normalize` option is set to `true` to allow searches to be normalized 
for Unicode characters.
  The `ascii_only` option is set to `true` to allow searches to be limited to 
ASCII characters.
 -The `shards` option sets the number of in-memory index shards per Memtable. 
(Set to `'auto'` for `cassandra.memtable.shard.count` shards. Not supported on 
vector column indexes.)
++The `shards` option sets the number of in-memory index shards per Memtable. 
(Set to `'auto'` or leave unspecified for `cassandra.memtable.shard.count` 
shards. Not supported on vector column indexes.)
  
  The `map` collection data type is the one exception, as shown in the 
xref:#map-collection-in-sai-index[example below].
  
diff --cc doc/modules/cassandra/pages/reference/cql-commands/create-index.adoc
index 5b191709e5,5a2802f45d..b62898aee9
--- a/doc/modules/cassandra/pages/reference/cql-commands/create-index.adoc
+++ b/doc/modules/cassandra/pages/reference/cql-commands/create-index.adoc
@@@ -107,6 -107,12 +107,12 @@@ Default: `false`
  The similarity function is used to compute the similarity between two vectors.
  Valid options are: `EUCLIDEAN`, `DOT_PRODUCT`, `COSINE`
  Default: `COSINE`
+ |`shards` |Number of in-memory index shards per memtable. Set to `'auto'` to 
use `cassandra.memtable.shard.count` shards.
+ 
+ Not supported on vector column indexes.
+ 
 -Default: `1`
++Default: `cassandra.memtable.shard.count`
+ Maximum: `256`
  |============================
  
  == Usage notes
diff --cc src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java
index 99c008b22f,9f93e0bf95..797acc66de
--- a/src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java
+++ b/src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java
@@@ -213,6 -228,14 +226,14 @@@ public class StorageAttachedIndex imple
              maxTermSizeGuardrail = Guardrails.saiBlobTermSize;
          else
              maxTermSizeGuardrail = Guardrails.saiStringTermSize;
+ 
+         String shardsOption = 
indexMetadata.options.get(ShardedMemtableIndex.SHARDS_OPTION);
 -        if (shardsOption == null)
++        if (indexTermType.isVector())
+             shardCount = 1;
 -        else if (shardsOption.equalsIgnoreCase(AUTO_SHARDS_OPTION))
++        else if (shardsOption == null || 
shardsOption.equalsIgnoreCase(AUTO_SHARDS_OPTION))
+             shardCount = DEFAULT_SHARD_COUNT;
+         else
+             shardCount = Integer.parseInt(shardsOption);
      }
  
      /**


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

Reply via email to