josh-mckenzie commented on code in PR #1855:
URL: https://github.com/apache/cassandra/pull/1855#discussion_r974485310
##########
test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java:
##########
@@ -247,6 +253,23 @@ public void testReadRateTracking()
Util.getAll(Util.cmd(store, key).includeRow("0").build());
assertEquals(2, sstable.getReadMeter().count());
+
+ // With persistence enabled, we should be able to retrieve the state
of the meter.
+ sstable.maybePersistSSTableReadMeter();
+
+ UntypedResultSet meter =
SystemKeyspace.readSSTableActivity(store.keyspace.getName(), store.name,
sstable.descriptor.id);
+ // So this is the only issue atm; seems like it's empty
+ assertFalse(meter.isEmpty());
+
+ Util.getAll(Util.cmd(store, key).includeRow("0").build());
+ assertEquals(3, sstable.getReadMeter().count());
+
+ // After cleaning existing state and disabling persistence, there
should be no meter state to read.
+ SystemKeyspace.clearSSTableReadMeter(store.keyspace.getName(),
store.name, sstable.descriptor.id);
+ DatabaseDescriptor.setSStableReadRatePersistenceEnabled(false);
Review Comment:
Good catch; I'm going to try/finally wrap it on commit just to make sure it
reverts to whatever it entered with. Better safe than sorry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]