From e4fe6fa3fa721e1f6516c55d607fa13e3abc7a45 Mon Sep 17 00:00:00 2001 From: Caleb Rackliffe Date: Fri, 26 Jun 2026 15:35:42 -0400 Subject: [PATCH] Make synchronization on VectorMemoryIndex inserts more granular patch by Caleb Rackliffe; reviewed by ? for CASSANDRA-21160 --- .../apache/cassandra/index/sai/memory/VectorMemoryIndex.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/cassandra/index/sai/memory/VectorMemoryIndex.java b/src/java/org/apache/cassandra/index/sai/memory/VectorMemoryIndex.java index c9d5aa28895..1bad3d88cc5 100644 --- a/src/java/org/apache/cassandra/index/sai/memory/VectorMemoryIndex.java +++ b/src/java/org/apache/cassandra/index/sai/memory/VectorMemoryIndex.java @@ -86,7 +86,7 @@ public VectorMemoryIndex(StorageAttachedIndex index, Memtable memtable) } @Override - public synchronized long add(DecoratedKey key, Clustering clustering, ByteBuffer value) + public long add(DecoratedKey key, Clustering clustering, ByteBuffer value) { if (value == null || value.remaining() == 0 || !index.validateTermSize(key, value, false, null)) return 0; @@ -146,7 +146,7 @@ public long update(DecoratedKey key, Clustering clustering, ByteBuffer oldVal return bytesUsed; } - private void updateKeyBounds(PrimaryKey primaryKey) + private synchronized void updateKeyBounds(PrimaryKey primaryKey) { if (minimumKey == null) minimumKey = primaryKey;