diff --git a/src/Cassandra/Orleans.Clustering.Cassandra/OrleansQueries.cs b/src/Cassandra/Orleans.Clustering.Cassandra/OrleansQueries.cs index 0ca3844a977..e0ec8a572b7 100644 --- a/src/Cassandra/Orleans.Clustering.Cassandra/OrleansQueries.cs +++ b/src/Cassandra/Orleans.Clustering.Cassandra/OrleansQueries.cs @@ -197,9 +197,10 @@ UPDATE membership IF version = :expected_version; """, + // This is ignored because we're creating a LWT MembershipWriteConsistencyLevel); - return _updateIAmAliveWithTtlPreparedStatement.Bind(new + BoundStatement updateIAmAliveTimeWithTtL = _updateIAmAliveWithTtlPreparedStatement.Bind(new { partition_key = clusterIdentifier, // The same version still needs to be written, to update its cell-level TTL @@ -217,6 +218,10 @@ UPDATE membership // But we still check that the version was the same during the update so we don't stomp on another update expected_version = existingVersion.Version, }); + + // To improve performance, we allow IAmAlive updates to be LocalSerial + updateIAmAliveTimeWithTtL.SetSerialConsistencyLevel(ConsistencyLevel.LocalSerial); + return updateIAmAliveTimeWithTtL; } public async ValueTask DeleteMembershipEntry(string clusterIdentifier, MembershipEntry membershipEntry)