cassandra icon indicating copy to clipboard operation
cassandra copied to clipboard

CNDB-9821 Lock-free RequestSensors#syncAllSensors implementation

Open aymkhalil opened this issue 1 year ago • 2 comments

Addresses: https://github.com/riptano/cndb/issues/9821

This is another proposal (see https://github.com/datastax/cassandra/pull/1156) to implement a lock-free RequestSensors#syncAllSensors. The sensor changes are anti-pattern but maybe justified for optimization purposes. This patch alleviates the need of ReadWrite locks and the in memory sensors value snapshots.

The benchmark results are:

Benchmark                            Mode  Cnt      Score      Error  Units
RequestSensorsBench.syncAllSensors  thrpt    5  48446.429 ± 7200.384  ops/s

vs.

Benchmark                            Mode  Cnt     Score     Error  Units
RequestSensorsBench.syncAllSensors  thrpt    5  8978.558 ± 674.063  ops/s

without this patch. Note that the improvements from https://github.com/datastax/cassandra/pull/1156.

aymkhalil avatar Jun 17 '24 23:06 aymkhalil

I am not sure we can trust this benchmark mainly because SensorRegistry is not incrementing (returning empty sensor) unless we populate keyspace and tableId in the setup

niksajakovljevic avatar Jul 01 '24 11:07 niksajakovljevic

Closed in favor of https://github.com/datastax/cassandra/pull/1184

aymkhalil avatar Aug 13 '24 15:08 aymkhalil