fix(lfs): ensure lock listing paginates with a total order - #38850
Open
viralpraxis wants to merge 1 commit into
Open
fix(lfs): ensure lock listing paginates with a total order#38850viralpraxis wants to merge 1 commit into
viralpraxis wants to merge 1 commit into
Conversation
`GetLFSLockByRepoID` applies `LIMIT`/`OFFSET` to a query with no `ORDER BY`. The order of such a query is unspecified (according to the SQL standard), so two page requests may see different orders and the pages stop tiling: one lock is returned twice while another is never returned at all. These locks are never updated, so in practice the order is insertion-based, but that's not guaranteed. Found by the `pg_disorder` PostgreSQL extension: https://github.com/viralpraxis/pg_disorder Assisted-by: Claude Code:claude-opus-5
viralpraxis
force-pushed
the
fix-lfs-lock-pagination-total-order
branch
from
August 12, 2026 18:41
a803cb0 to
8cc3010
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetLFSLockByRepoIDappliesLIMIT/OFFSETto a query with noORDER BY. The order of such a query is unspecified (according to the SQL standard), so the resulting queryset might be inconsistent.These locks AFAIK are never updated, so in practice the order is insertion-based, but that's not guaranteed.
Found by the
pg_disorderPostgreSQL extension