Maxwell-Guo commented on code in PR #2894:
URL: https://github.com/apache/cassandra/pull/2894#discussion_r1403921456


##########
test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java:
##########
@@ -142,11 +144,12 @@ public void cleanDir() throws IOException
     public static Collection<Object[]> buildParameterizedVariants()
     {
         return Arrays.asList(new Object[][]{
-        {null, EncryptionContextGenerator.createDisabledContext()}, // No 
compression, no encryption
-        {null, EncryptionContextGenerator.createContext(true)}, // Encryption
-        { new ParameterizedClass(LZ4Compressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()},
-        { new ParameterizedClass(SnappyCompressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()},
-        { new ParameterizedClass(DeflateCompressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()}});
+        {null, EncryptionContextGenerator.createDisabledContext(), 
Config.DiskAccessMode.legacy}, // No compression, no encryption, legacy
+        {null, EncryptionContextGenerator.createDisabledContext(), 
Config.DiskAccessMode.direct}, // Use Direct-I/O (non-buffered) feature.
+        {null, EncryptionContextGenerator.createContext(true), 
Config.DiskAccessMode.legacy},

Review Comment:
   I just add initializeCommitLogDiskAccessMode() after 
[here](https://github.com/jacek-lewandowski/cassandra/blob/CASSANDRA-18464/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java#L103)
 and test passed.



##########
test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java:
##########
@@ -142,11 +144,12 @@ public void cleanDir() throws IOException
     public static Collection<Object[]> buildParameterizedVariants()
     {
         return Arrays.asList(new Object[][]{
-        {null, EncryptionContextGenerator.createDisabledContext()}, // No 
compression, no encryption
-        {null, EncryptionContextGenerator.createContext(true)}, // Encryption
-        { new ParameterizedClass(LZ4Compressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()},
-        { new ParameterizedClass(SnappyCompressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()},
-        { new ParameterizedClass(DeflateCompressor.class.getName(), 
Collections.emptyMap()), EncryptionContextGenerator.createDisabledContext()}});
+        {null, EncryptionContextGenerator.createDisabledContext(), 
Config.DiskAccessMode.legacy}, // No compression, no encryption, legacy
+        {null, EncryptionContextGenerator.createDisabledContext(), 
Config.DiskAccessMode.direct}, // Use Direct-I/O (non-buffered) feature.
+        {null, EncryptionContextGenerator.createContext(true), 
Config.DiskAccessMode.legacy},

Review Comment:
   I ran the test locally , just pull the patch (I do not change anything), I 
found that the test will always fails, as
   though we set the dis access to  Config.DiskAccessMode.legacy here when  
EncryptionContextGenerator.createContext(true), But the value of 
[commitLogWriteDiskAccessMode](https://github.com/jacek-lewandowski/cassandra/blob/CASSANDRA-18464/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L182)
 is not changed (which is only changed by 
i[nitializeCommitLogDiskAccessMode()](https://github.com/jacek-lewandowski/cassandra/blob/CASSANDRA-18464/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L2718)
 at the first start up as CommitlogStressTest's config  is only initialize once 
at the 
[BeforeClass](https://github.com/jacek-lewandowski/cassandra/blob/CASSANDRA-18464/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java#L119))



-- 
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]

Reply via email to