Skip to content
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

Pagination Issues: Duplicated Maven Packages in GET API Responses #30718

Open
Diasastr opened this issue Apr 26, 2024 · 1 comment
Open

Pagination Issues: Duplicated Maven Packages in GET API Responses #30718

Diasastr opened this issue Apr 26, 2024 · 1 comment

Comments

@Diasastr
Copy link

Description

When querying Maven packages from the Gitea using the endpoint {base_url}/packages/{owner}?page={page}&limit={PAGE_SIZE}&type=maven, duplicate entries appear across different pages, especially when the total number of packages is very large (like 20,000). Sometimes, if you request the same page again, the duplicate packages won't appear, showing that the way pages are filled with packages can be unpredictable. Additionally, if you make the same request multiple times, you might get different packages each time.

Gitea Version: a36636357
Deployment: The Gitea instance is running within a Kubernetes pod managed by Rancher.
Database Used: PostgreSQL 12.17-bullseye
Additional Context: This issue might be related to how pagination is implemented in the backend storage or indexing system used by Gitea for package management.

Steps to Reproduce

  1. Send a GET request to {base_url}/packages/{owner}?page=1&limit=20&type=maven with a high total package count ( in our case more then 20000)
  2. Note the packages returned and repeat the request for the same page.
  3. Compare the results from both requests and note any duplicates.
  4. Optionally, continue to the next page and check for overlap with previous pages.

Expected Behavior

Each page requested should return a unique set of packages without overlap, regardless of the number of times the same page is queried.

Actual Behavior

Some package entries are duplicated across multiple page results, and the same page request can yield different packages on subsequent queries.

Gitea Version

a36636357

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Linux

How are you running Gitea?

The Gitea instance is running within a Kubernetes pod managed by Rancher.

Database

PostgreSQL

@KN4CK3R
Copy link
Member

KN4CK3R commented Apr 28, 2024

Do you know it that's a new problem? Then #30520 could be the reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants