samueldlightfoot commented on code in PR #4606:
URL: https://github.com/apache/cassandra/pull/4606#discussion_r2917481523
##########
src/java/org/apache/cassandra/utils/memory/MemoryUtil.java:
##########
@@ -330,9 +331,13 @@ public static void clean(ByteBuffer buffer)
return;
DirectBuffer db = (DirectBuffer) buffer;
- if (db.attachment() != null)
- return; // duplicate or slice
-
- unsafe.invokeCleaner(buffer);
+ if (db.attachment() instanceof ByteBuffer)
Review Comment:
Good idea. I've reworked this around the concept that a root allocation
always has a cleaner, and anything that doesn't with an attachment (like a
slice) is an issue.
##########
test/unit/org/apache/cassandra/db/compaction/CompactionsTest.java:
##########
@@ -260,8 +303,9 @@ public static void assertMaxTimestamp(ColumnFamilyStore
cfs, long maxTimestampEx
public void testUserDefinedCompaction() throws Exception
{
Keyspace keyspace = Keyspace.open(KEYSPACE1);
- final String cfname = "Standard3"; // use clean(no sstable) CF
+ final String cfname = "Standard3";
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfname);
+ cfs.clearUnsafe();
Review Comment:
Due to the test now being parameterised and thus running multiple times on
the Standard3 table. It was brittle in that it relied on no other tests in the
suite using Standard3.
--
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]