[
https://issues.apache.org/jira/browse/CASSANDRA-15105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16846511#comment-16846511
]
Per Otterström commented on CASSANDRA-15105:
--------------------------------------------
[~sumanth.pasupuleti], thanks for taking the time to review and test.
When looking at the logs of the
[failing|https://circleci.com/gh/sumanth-pasupuleti/cassandra/508#tests/containers/14]
test I don't think that run was affected by the setup in
{{StorageServiceServerTest}} as these were the only test classes executed in
that particular container:
{noformat}
org/apache/cassandra/audit/AuditLoggerTest.java
org/apache/cassandra/db/commitlog/CommitLogFailurePolicyTest.java
org/apache/cassandra/dht/RandomPartitionerTest.java
org/apache/cassandra/locator/NetworkTopologyStrategyTest.java
org/apache/cassandra/service/NativeTransportServiceTest.java
org/apache/cassandra/utils/NativeLibraryTest.java
{noformat}
Still, I think that disabling the audit logger whenever it has been enabled is
a good strategy.
But regarding the, still flaky, {{testExcludeSystemKeyspaces}}. I was able to
reproduce the remaining issue consistently by adding a a few seconds delay in
the test case just before checking the size of the
{{InMemoryAuditLogger.inMemQueue}}. When printing the content I get this:
{noformat}
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418723|type:SELECT|category:QUERY|ks:system_schema|scope:keyspaces|operation:SELECT
* FROM system_schema.keyspaces
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418722|type:SELECT|category:QUERY|ks:system_schema|scope:keyspaces|operation:SELECT
* FROM system_schema.keyspaces
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418723|type:SELECT|category:QUERY|ks:system_schema|scope:keyspaces|operation:SELECT
* FROM system_schema.keyspaces
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418732|type:SELECT|category:QUERY|ks:system_schema|scope:types|operation:SELECT
* FROM system_schema.types
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418732|type:SELECT|category:QUERY|ks:system_schema|scope:types|operation:SELECT
* FROM system_schema.types
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418732|type:SELECT|category:QUERY|ks:system_schema|scope:types|operation:SELECT
* FROM system_schema.types
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418736|type:SELECT|category:QUERY|ks:system_schema|scope:tables|operation:SELECT
* FROM system_schema.tables
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418736|type:SELECT|category:QUERY|ks:system_schema|scope:tables|operation:SELECT
* FROM system_schema.tables
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418735|type:SELECT|category:QUERY|ks:system_schema|scope:tables|operation:SELECT
* FROM system_schema.tables
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418751|type:SELECT|category:QUERY|ks:system_schema|scope:columns|operation:SELECT
* FROM system_schema.columns
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418750|type:SELECT|category:QUERY|ks:system_schema|scope:columns|operation:SELECT
* FROM system_schema.columns
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418752|type:SELECT|category:QUERY|ks:system_schema|scope:columns|operation:SELECT
* FROM system_schema.columns
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418766|type:SELECT|category:QUERY|ks:system_schema|scope:indexes|operation:SELECT
* FROM system_schema.indexes
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418767|type:SELECT|category:QUERY|ks:system_schema|scope:indexes|operation:SELECT
* FROM system_schema.indexes
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418767|type:SELECT|category:QUERY|ks:system_schema|scope:indexes|operation:SELECT
* FROM system_schema.indexes
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418767|type:SELECT|category:QUERY|ks:system_schema|scope:views|operation:SELECT
* FROM system_schema.views
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418768|type:SELECT|category:QUERY|ks:system_schema|scope:views|operation:SELECT
* FROM system_schema.views
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418768|type:SELECT|category:QUERY|ks:system_schema|scope:views|operation:SELECT
* FROM system_schema.views
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418769|type:SELECT|category:QUERY|ks:system_schema|scope:functions|operation:SELECT
* FROM system_schema.functions
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418769|type:SELECT|category:QUERY|ks:system_schema|scope:functions|operation:SELECT
* FROM system_schema.functions
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36848|timestamp:1558592418770|type:SELECT|category:QUERY|ks:system_schema|scope:aggregates|operation:SELECT
* FROM system_schema.aggregates
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418770|type:SELECT|category:QUERY|ks:system_schema|scope:functions|operation:SELECT
* FROM system_schema.functions
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36852|timestamp:1558592418771|type:SELECT|category:QUERY|ks:system_schema|scope:aggregates|operation:SELECT
* FROM system_schema.aggregates
user:anonymous|host:127.0.0.1:7010|source:/127.0.0.1|port:36856|timestamp:1558592418771|type:SELECT|category:QUERY|ks:system_schema|scope:aggregates|operation:SELECT
* FROM system_schema.aggregates
{noformat}
Some further testing indicates that other test cases were vulnerable to this as
well, all depending on execution order and timing. I believe that the queries
we see come from the control connection for each of the sessions in
{{CQLTester}}, a few for each protocol version.
So, created another patch, making sure to exclude system keyspaces where it
makes sense. This is a detail we overlooked when working on CASSANDRA-14498.
Not sure what's the best way to get my latest patch on top of yours. Since you
created a PR, perhaps you could merge my latest patch on to your branch?
> Flaky unit test AuditLoggerTest
> -------------------------------
>
> Key: CASSANDRA-15105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15105
> Project: Cassandra
> Issue Type: Bug
> Components: Legacy/CQL
> Reporter: Per Otterström
> Assignee: Per Otterström
> Priority: Normal
> Fix For: 4.0
>
>
> Depending on execution order some tests will fail in the AuditLoggerTest
> class. Any test case that happens to execute after
> testExcludeSystemKeyspaces() will typically fail.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]