[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-03 Thread Alexandre Dutra (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293772#comment-17293772
 ] 

Alexandre Dutra edited comment on CASSANDRA-16444 at 3/3/21, 9:54 AM:
--

[~blerer] I investigated the change introduced by CASSANDRA-15867.

In fact, this change simply fixed a test that was failing for a while.

Doing a git bisect, I found that the commit that introduced the test regression 
is in fact c4064dd: [Allow recovery from the cases when CQL-created compact 
sense tables have bytes in EmptyType 
columns|https://github.com/apache/cassandra/commit/c4064dd80e427aec7c04e8e2e1e4630d6c8087b6#diff-0e5a142c13247885605175ace136c549391fb6c778877f91f589fd94131c241b].

This change introduced an assertion inside {{AbstractType.writeValue()}}:
{code:java}
assert valueLengthIfFixed < 0 || value.remaining() == 
valueLengthIfFixed : String.format("Expected exactly %d bytes, but was %d",

 valueLengthIfFixed, value.remaining());
{code}
Without the assert, the incorrect 8-bytes value created by 
{{testInsertingIncorrectValuesIntoAgeIndex}} gets written; with the assertion, 
it doesn't, and the {{AssertionError}} bubbles up, messing up the store state. 
The author of CASSANDRA-15867 simply added a try-catch block around the test to 
avoid the test failure. But I wonder if we shouldn't simply disable this test, 
since it violates an invariant expressed by the new assertion.

Oddly enough, this assertion was not ported to trunk, which basically conserved 
the pre-c4064dd behavior. This is why this test 
({{testInsertingIncorrectValuesIntoAgeIndex}}) is not dangerous on trunk: it 
passes normally and doesn't leave the store in an inconsistent state; therefore 
it doesn't need a try-catch block nor any ugly band-aid to fix the store state.


was (Author: adutra):
[~blerer] I investigated the change introduced by CASSANDRA-15867.

In fact, this change simply fixed a test that was failing for a while.

Doing a git bisect, I found that the commit that introduced the test regression 
is in fact c4064dd: [Allow recovery from the cases when CQL-created compact 
sense tables have bytes in EmptyType 
columns|https://github.com/apache/cassandra/commit/c4064dd80e427aec7c04e8e2e1e4630d6c8087b6#diff-0e5a142c13247885605175ace136c549391fb6c778877f91f589fd94131c241b].

This change introduced an assertion inside {{AbstractType.writeValue()}}:
{code:java}
assert valueLengthIfFixed < 0 || value.remaining() == 
valueLengthIfFixed : String.format("Expected exactly %d bytes, but was %d",

 valueLengthIfFixed, value.remaining());
{code}
Without the assert, the incorrect 8-bytes value created by 
{{testIndexMemtableSwitching}} gets written; with the assertion, it doesn't, 
and the {{AssertionError}} bubbles up, messing up the store state. The author 
of CASSANDRA-15867 simply added a try-catch block around the test to avoid the 
test failure. But I wonder if we shouldn't simply disable this test, since it 
violates an invariant expressed by the new assertion.

Oddly enough, this assertion was not ported to trunk, which basically conserved 
the pre-c4064dd behavior. This is why this test is not dangerous on trunk: it 
passes normally and doesn't leave the store in an inconsistent state; therefore 
it doesn't need a try-catch block nor any ugly band-aid to fix the store state.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17292834#comment-17292834
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 4:05 PM:
-

Thanks for the patches and the deep analysis.

* I believe that even if it does not appear as a problem right now we should 
make the tests more robusts. 2 things that strike me are that the tables are 
not cleaned up between the tests and that {{forcedFlushes}} are used but the 
tests do not disable the automatic flushes.

I would change the {{cleanupData}} method into:
{code}
private static void cleanupData()
{
stores().forEach(ColumnFamilyStore::truncateBlocking);
}

private static Stream stores()
{
Keyspace ks = Keyspace.open(KS_NAME);
return ks.getMetadata().tables.stream().map(t -> 
ks.getColumnFamilyStore(t.name));
}
{code}

and the {{cleanUp}} method into:
{code}
@Before
public void cleanUp()
{
cleanupData();
}
{code} 
That would ensure that we clean all the tables between the different tests.

I would also add 
{{stores().forEach(ColumnFamilyStore::disableAutoCompaction);}} at the end of 
the {{loadSchema()}} method to ensure that there are no race condition with 
automatic compactions.

* Regarding the timestamp fix, would it not make sense to use some thing like:
{code}
private static long timestamp = 0;

private static long nextTimestamp()
{
timestamp += 1000;
return timestamp;
}
{code}
rather than specifying the timestamp for each call to {{loadData}}?

* Regarding {{testInsertingIncorrectValuesIntoAgeIndex}} problem in 3.11, it 
seems that the test has been changed as part of CASSANDRA-15867 and I am not 
convinced that this change was the correct one. If you roll back that change, 
do you still see the same issue?


was (Author: blerer):
Thanks for the patches and the deep analysis.

* I believe that even if it does not appear as a problem right now we should 
make the tests more robusts. 2 things that strike me are that the tables are 
not cleaned up between the tests and that {{forcedFlushes}} are used but the 
tests do not disable the automatic flushes.

I would change the {{cleanupData}} method into:
{code}
private static void cleanupData()
{
stores().forEach(ColumnFamilyStore::truncateBlocking);
}

private static Stream stores()
{
Keyspace ks = Keyspace.open(KS_NAME);
return ks.getMetadata().tables.stream().map(t -> 
ks.getColumnFamilyStore(t.name));
}
{code}

and the {{cleanUp}} method into:
{code}
@Before
public void cleanUp()
{
cleanupData();
}
{code} 
That would ensure that we clean all the tables between the different tests.

I would also add 
{{stores().forEach(ColumnFamilyStore::disableAutoCompaction);}} at the end of 
the {{loadSchema()}} method to ensure that there are no race condition with 
automatic compactions.

* Regarding the timestamp fix, would it not make sense to use some thing like:
{code}
private static long timestamp = 0;

private static long nextTimestamp()
{
timestamp += 1000;
return timestamp;
}
{code}
rather than specifying the timestamp for each call to {{loadData}}?

* Regarding {{testIndexMemtableSwitching}} problem in 3.11, it seems that the 
test has been changed as part of CASSANDRA-15867 and I am not convinced that 
this change was the correct one. If you roll back that change, do you still see 
the same issue?

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:43 PM:
-

{quote}forcedFlushes are used but the tests do not disable the automatic flushes

 How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables\{quote}

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.


was (Author: blerer):
{quote} bq.forcedFlushes are used but the tests do not disable the automatic 
flushes

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables\{quote}

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:43 PM:
-

{quote}forcedFlushes are used but the tests do not disable the automatic flushes

 How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables{quote}

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.


was (Author: blerer):
{quote}forcedFlushes are used but the tests do not disable the automatic flushes

 How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables\{quote}

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:42 PM:
-

{quote} bq.forcedFlushes are used but the tests do not disable the automatic 
flushes

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables\{quote}

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.


was (Author: blerer):
?? ??forcedFlushes are used but the tests do not disable the automatic flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables??

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:41 PM:
-

?? ??forcedFlushes are used but the tests do not disable the automatic flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables??

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
 Sorry for that.


was (Author: blerer):
???  ??forcedFlushes are used but the tests do not disable the automatic 
flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables???

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:40 PM:
-

???  ??forcedFlushes are used but the tests do not disable the automatic 
flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables???

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
Sorry for that.


was (Author: blerer):
?? > forcedFlushes are used but the tests do not disable the automatic flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables???

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17293783#comment-17293783
 ] 

Benjamin Lerer edited comment on CASSANDRA-16444 at 3/2/21, 3:40 PM:
-

?? > forcedFlushes are used but the tests do not disable the automatic flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables???

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
Sorry for that.


was (Author: blerer):
?? ??forcedFlushes are used but the tests do not disable the automatic flushes??

How would you do this? Should I play with memtable_flush_period_in_ms when 
creating the tables???

Ignore my comment. I think I mixed up several things in my mind when I wrote 
that comment. By default flushes are not triggered periodically.
Sorry for that.

> Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - 
> org.apache.cassandra.index.sasi.SASIIndexTest
> -
>
> Key: CASSANDRA-16444
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16444
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/unit
>Reporter: David Capwell
>Assignee: Alexandre Dutra
>Priority: Normal
> Fix For: 4.0-beta
>
>
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/862/workflows/d2b10373-5bd1-4895-a738-1c28587cae62/jobs/5136
> {code}
> junit.framework.AssertionFailedError: []
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:589)
>   at 
> org.apache.cassandra.index.sasi.SASIIndexTest.testMultiExpressionQueriesWhereRowSplitBetweenSSTables(SASIIndexTest.java:468)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-03-02 Thread Alexandre Dutra (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17290027#comment-17290027
 ] 

Alexandre Dutra edited comment on CASSANDRA-16444 at 3/2/21, 2:21 PM:
--

What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInsertingIncorrectValuesIntoAgeIndex}} is executed before:
 ## {{testInsertingIncorrectValuesIntoAgeIndex}} leaves the store in an 
inconsistent state due to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching}} verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside 
{{store.runWithCompactionsDisabled()}}. 
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
{{testInsertingIncorrectValuesIntoAgeIndex}}, so as to leave the store in a 
consistent state.


was (Author: adutra):
What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInvalidIndexOptions}} is executed before:
 ## {{testInvalidIndexOptions}} leaves the store in an inconsistent state due 
to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching}} verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside 
{{store.runWithCompactionsDisabled()}}. 
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
the test, 

[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-02-24 Thread Alexandre Dutra (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17290027#comment-17290027
 ] 

Alexandre Dutra edited comment on CASSANDRA-16444 at 2/24/21, 4:36 PM:
---

What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInvalidIndexOptions}} is executed before:
 ## {{testInvalidIndexOptions}} leaves the store in an inconsistent state due 
to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching}} verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside 
{{store.runWithCompactionsDisabled()}}. 
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
the test, so as to leave the store in a consistent state.


was (Author: adutra):
What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInvalidIndexOptions}} is executed before:
 ## {{testInvalidIndexOptions}} leaves the store in an inconsistent state due 
to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching}} verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside {{ 
store.runWithCompactionsDisabled()}}. 
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
the test, so as to leave the store in a consistent state.

> Fix flaky test 

[jira] [Comment Edited] (CASSANDRA-16444) Fix flaky test testMultiExpressionQueriesWhereRowSplitBetweenSSTables - org.apache.cassandra.index.sasi.SASIIndexTest

2021-02-24 Thread Alexandre Dutra (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17290027#comment-17290027
 ] 

Alexandre Dutra edited comment on CASSANDRA-16444 at 2/24/21, 3:48 PM:
---

What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInvalidIndexOptions}} is executed before:
 ## {{testInvalidIndexOptions}} leaves the store in an inconsistent state due 
to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching}} verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside {{ 
store.runWithCompactionsDisabled()}}. 
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
the test, so as to leave the store in a consistent state.


was (Author: adutra):
What I've got so far:
 # The usage of {{System.currentTimeMillis()}} to generate timestamps is 
error-prone. Some tests create and apply many mutations in sequence, but 
sometimes 2 successive mutations get the same timestamp, and the test fails. 
The following tests are potentially impacted by this:
 ## testCrossSSTableQueries
 ## testMultiExpressionQueriesWhereRowSplitBetweenSSTables
 ## testPagination
 ## testColumnNamesWithSlashes
 ## testInvalidate
 ## testIndexRedistribution
 ## testTruncate
 ## testSameKeyInMemtableAndSSTables
 ## testUnicodeSupport
 ## testUnicodeSuffixModeNoSplits
 ## testChinesePrefixSearch
 ## testLowerCaseAnalyzer
 ## testPrefixSSTableLookup
 ## testIndexMemtableSwitching
 # {{testIndexRedistribution}}: race condition. The test fails when a 
{{CompactionTask}} is running while {{getIndexed()}} is called. 
 ## Wrapping {{getIndexed()}} call within 
{{store.runWithCompactionsDisabled()}} solves the problem.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
index redistribution in general._
 # {{testIndexMemtableSwitching}}: side-effect issue. The test fails only if 
{{testInvalidIndexOptions}} is executed before:
 ## {{testInvalidIndexOptions}} leaves the store in an inconsistent state due 
to an invalid mutation. 
 ## The next memtable flush task fails because of an invalid cell type created 
by the test.
 ## afaict, the memtable stays forever among the pending memtables list and 
will never be flushed or removed.
 ## Similarly, {{ColumnIndex}} never gets a notification that the parent 
memtable was flushed, and so {{ColumnIndex.pendingFlush}} is never cleared.
 ## {{testIndexMemtableSwitching }}verifies that {{ColumnIndex.pendingFlush}} 
is empty, and fails.
 ## _I am not expert enough to tell if this is hiding a broader problem with 
failed memtable flushes._

I am going to propose 3 distinct patches:
 # Replace all occurrences of {{System.currentTimeMillis()}} in 
{{SASIIndexTest}} by fixed timestamps.
 # Fix {{testIndexRedistribution}} by reading the index contents inside{{ 
store.runWithCompactionsDisabled().}}
 # {{testIndexMemtableSwitching}}: manually clear the store memtables using 
{{store.clearUnsafe()}} and manually clean {{ColumnIndex.pendingFlush}} after 
the test, so as to leave the store in a consistent state.{{}}

> Fix flaky