-
Notifications
You must be signed in to change notification settings - Fork 2
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
there may be a Bug with paging. #4
Comments
Query with QueryParams will block when page_size is other than 1. This can checked with very simple code |
@thegenius thanks for the reporting. 👍 |
Perhaps you may want to check if the server has more page by using response metadata instead of if rows_cnt == 0 {
return
} Please check pager implementation of the sync version https://github.com/AlexPikalov/cdrs/blob/master/src/cluster/pager.rs#L115. With that logic in place you'd need to add an exit condition to the end of the loop step as in the sync example |
Nevertheless pager helper is something that is definitely missed in async version. |
I made a simple example, the query_body function will block when params is: query_body implement as below: `async fn query_body(&mut self, query_str: &str, params: QueryParams) ->Result {
there are 4 rows in the table, and when page_size set to 1, the query_body function will not block; |
OS: macOS |
👍 thanks! I'll check this out! |
@krojew have you fixed this issue in your fork? |
@Jasperav to be honest - I don't know if this bug even exists in cdrs-tokio. |
@krojew well I guess if the tests are green after merging AlexPikalov/cdrs#337 in your fork, there shouldn't be a paging bug (since I included a test in that PR that tests the paging functionality) |
@Jasperav I can confirm new tests pass. |
@thegenius if you can switch over to krojew's fork and it also works for you, please close this issue |
`let mut loop_index = 0;
let mut paging_state = None;
loop {
println!("loop index: {:?}", &loop_index);
println!("pagin state: {:?}", &paging_state);
let params = page_request.build_query_params(paging_state, None);
let body: ResponseBody = scylladb
.query_body(&page_request.row_query_str, params)
.await
.unwrap();
The text was updated successfully, but these errors were encountered: