In Progress
Status Update
Comments
lu...@gmail.com <lu...@gmail.com> #2
I managed to reproduce the problem, thanks for raising it.
lu...@gmail.com <lu...@gmail.com> #3
Amended the description with the exact steps to reproduce the issue with a brand-new site. Please note that without a private project with non-visible changes to the anonymous users, the problem does not show up.
lu...@gmail.com <lu...@gmail.com> #4
ap...@google.com <ap...@google.com> #5
Project: gerrit
Branch: stable-3.4
commit 242d514e6143b2d9c38b4bc27f4617289f27a853
Author: Diego Zambelli Sessona <diego.sessona@gmail.com>
Date: Thu Mar 14 15:12:04 2024
Add tests for pagination to back fill the results
When querying Lucene, if we have not filled the full
limit the caller wants, `PaginatingSource.read()`
need to restart the source and continue. This should happen
regardless of the paginationType.
Bug: Issue 328958027
Release-Notes: skip
Change-Id: I02bc97eeecde2149e374dd036b87dd4c06034f27
M javatests/com/google/gerrit/server/query/change/LuceneQueryChangesTest.java
https://gerrit-review.googlesource.com/413539
Branch: stable-3.4
commit 242d514e6143b2d9c38b4bc27f4617289f27a853
Author: Diego Zambelli Sessona <diego.sessona@gmail.com>
Date: Thu Mar 14 15:12:04 2024
Add tests for pagination to back fill the results
When querying Lucene, if we have not filled the full
limit the caller wants, `PaginatingSource.read()`
need to restart the source and continue. This should happen
regardless of the paginationType.
Bug:
Release-Notes: skip
Change-Id: I02bc97eeecde2149e374dd036b87dd4c06034f27
M javatests/com/google/gerrit/server/query/change/LuceneQueryChangesTest.java
ap...@google.com <ap...@google.com> #6
Project: gerrit
Branch: stable-3.4
commit db911c50c6d87d92da8f0c78dcf9063974269a18
Author: Diego Zambelli Sessona <diego.sessona@gmail.com>
Date: Thu Mar 14 16:26:27 2024
Fix visibility filter for changes when paginationType NONE
The introduction of paginationType NONE in
change 379354 affected the API pagination.
In particular, if some results are skipped because of
of the visibility constraints, more changes need to
be asked from the index, until we have filled the
full limit the caller wants or if there are no more
changes [1].
[1]:https://gerrit-review.googlesource.com/c/gerrit/+/379354/8/java/com/google/gerrit/index/query/PaginatingSource.java#72
Bug: Issue 328958027
Release-Notes: Fix NONE paginationType filtering of changes
Change-Id: I3ccff7f8ba5a6d3903f9acbe3f5c439c55225ce2
M java/com/google/gerrit/index/query/IndexedQuery.java
M java/com/google/gerrit/index/query/Paginated.java
M java/com/google/gerrit/index/query/PaginatingSource.java
M java/com/google/gerrit/lucene/LuceneChangeIndex.java
M javatests/com/google/gerrit/server/query/change/LuceneQueryChangesTest.java
https://gerrit-review.googlesource.com/413358
Branch: stable-3.4
commit db911c50c6d87d92da8f0c78dcf9063974269a18
Author: Diego Zambelli Sessona <diego.sessona@gmail.com>
Date: Thu Mar 14 16:26:27 2024
Fix visibility filter for changes when paginationType NONE
The introduction of paginationType NONE in
change 379354 affected the API pagination.
In particular, if some results are skipped because of
of the visibility constraints, more changes need to
be asked from the index, until we have filled the
full limit the caller wants or if there are no more
changes [1].
[1]:
Bug:
Release-Notes: Fix NONE paginationType filtering of changes
Change-Id: I3ccff7f8ba5a6d3903f9acbe3f5c439c55225ce2
M java/com/google/gerrit/index/query/IndexedQuery.java
M java/com/google/gerrit/index/query/Paginated.java
M java/com/google/gerrit/index/query/PaginatingSource.java
M java/com/google/gerrit/lucene/LuceneChangeIndex.java
M javatests/com/google/gerrit/server/query/change/LuceneQueryChangesTest.java
Description
Background:
We had some sporadic clones failures and based on the error_log stacks we were recommended to switch the index.paginationType to NONE in [1].
Doing this config change fixed our clone issue however it introduced an inconsistency on the changes queries, especially for non authenticated users (and users with restricted project visibilities)
With index.paginationType = None, an anonymous user only sees a few (open, merged, abandoned) changes on the dashboards (around ~20 for each), there is no next page. (we have ~100k merged changes so there should be lots of next pages)
Similarily a curl to changes/?q=status:merged&o=CURRENT_REVISION&o=CURRENT_COMMIT&n=500&S=0 will only return ~340 changes (instead of a full 500 + _more_changes = true
What steps will reproduce the problem?
Create two repositories, one public (
test-repo
) and one private (test-repo-private
)Push 1 change to
test-repo
Push 5 changes to
test-repo-private
Run the following command:
curl 'http://localhost:8080/changes/?S=0&n=1'
Expected behaviour
A list of changes in JSON format with 1 element.
Observed behaviour
An empty list.
Additional information below:
By commenting out the pagination type:
The curl returns 1 change as expected.
If in gerrit.config, I revert index.paginationType to OFFSET, then the dashboard are back OK, and the next page > icon appears and works, curl returns full 500changes and _more_changes is set to true.
with index.paginationType = NONE if I go to the merged changes of a specific project then I am able to browse up to it's beginning (as expected).
[1]https://groups.google.com/g/repo-discuss/c/vYjcgy7LCWM/m/P7jS08WJCgAJ