-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scan with filtering stopping on an empty page #180
Comments
@sylwiaszunejko - did we reproduce this? Do we have an existing test in other drivers (Python and friends) that we can 'translate' it? |
@mykaul I haven't started working on this issue yet, but I see that there is a test for empty pages in python-driver added datastax/python-driver@1d9077d |
Any update on the above issue? |
Update:
Quick fix for user: update iteration logic to stop iterating only when
I have quickly investigated posibility of automatically retry on empty iterators: |
Is the iterator in the Go API for pages or for individual rows? |
I have given it my best shot here, please take a look. |
Fixed in #212 |
@nyh Did you see @dkropachev PR? Are you satisfied with the outcome? |
@dkropachev please check if we want to add some documentation about previous behavior vs new. |
A user in stackoverflow, https://stackoverflow.com/questions/78544921/gocql-allow-filtering-returns-empty-records-with-page-size reported a bug when using Scylla and gocql, and scanning an entire partition with filtering (ALLOW FILTERING): If an entire page of results did not match the filter, then Scylla returns an empty page and gocql incorrectly stops the iteration immediately instead of continuing for the next page. His report has example code he used. I have not verified this report myself (I never used gocql myself).
If this report is true, I suspect it is a gocql bug, not a Scylla bug. We used to have this bug in the Python driver but it was fixed years ago (see scylladb/scylladb#8203, and the fix datastax/python-driver@1d9077d), and in the Java driver (apache/cassandra-java-driver#1544) and now I suspect we have the same bug in gocql.
We have a test in Scylla's test suite, test/cql-pytest/
test_filtering.py
::test_filtering_contiguous_nonmatching_partition_range
andtest_filtering_contiguous_nonmatching_single_partition
, using the fixed Python driver, which checks exactly this situation: a filtered scan of a table or partition with a large number of rows, only the very last of them actually matching the filter, so the first pages of results are empty. This is why I'm guessing the bug is in gocql, not in Scylla itself. By the way, if you want you can translate one of these tests into Go and see if it fails with gocql and later use it as a gocql unit test.By the way, after we solved this bug in the Python and Java drivers, we started to rely more and more on sending back empty pages. For example, we now send back an empty page also if we find ourselves scanning a very long list of tombstones, to avoid timeouts. Our drivers need to handle this case correctly.
The text was updated successfully, but these errors were encountered: