Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Stefan Miklosovic 2024-06-06 11:56:40 +02:00
commit cb9656b240
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
2 changed files with 11 additions and 4 deletions

View File

@ -44,6 +44,7 @@
* Add the ability to disable bulk loading of SSTables (CASSANDRA-18781)
* Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787)
Merged from 5.0:
* Replace Stream iteration with for-loop for StorageProxy::updateCoordinatorWriteLatencyTableMetric (CASSANDRA-19676)
* Enforce metric naming contract if scope is used in a metric name (CASSANDRA-19619)
* Avoid reading of the same IndexInfo from disk many times for a large partition (CASSANDRA-19557)
* Resolve the oldest hints just from descriptors and current writer if available (CASSANDRA-19600)

View File

@ -1273,10 +1273,16 @@ public class StorageProxy implements StorageProxyMBean
{
//We could potentially pass a callback into performWrite. And add callback provision for mutateCounter or mutateAtomically (sendToHintedEndPoints)
//However, Trade off between write metric per CF accuracy vs performance hit due to callbacks. Similar issue exists with CoordinatorReadLatency metric.
mutations.stream()
.flatMap(m -> m.getTableIds().stream().map(tableId -> Keyspace.open(m.getKeyspaceName()).getColumnFamilyStore(tableId)))
.distinct()
.forEach(store -> store.metric.coordinatorWriteLatency.update(latency, TimeUnit.NANOSECONDS));
Set<ColumnFamilyStore> uniqueColumnFamilyStores = new HashSet<>();
for (IMutation mutation : mutations)
{
for (TableId tableId : mutation.getTableIds())
{
ColumnFamilyStore store = Keyspace.open(mutation.getKeyspaceName()).getColumnFamilyStore(tableId);
if (uniqueColumnFamilyStores.add(store))
store.metric.coordinatorWriteLatency.update(latency, NANOSECONDS);
}
}
}
catch (Exception ex)
{