Characterize SQL cluster metadata pagination repeating its first page - #12017
Draft
taylan-oai wants to merge 1 commit into
Draft
taylan-oai wants to merge 1 commit into
taylan-oai wants to merge 1 commit into
Conversation
|
|
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.
Summary
Document and reproduce SQL cluster metadata pagination repeating its first page so a follow-up fix can restore forward progress without changing cluster lifecycle semantics.
Problem
The MySQL, PostgreSQL, and SQLite list queries select
data,data_encoding, andversion, but omitcluster_name.ListClusterMetadatabuilds the continuation token from the returned row'sClusterName, which remains empty. The serialized empty string is a nonempty token; the next request decodes it and chooses the initial query again.With two unchanged clusters and page size 1, every page returns the first cluster. A client following these tokens cannot reach later clusters or finish its traversal. The background cluster cache refresher and startup metadata loader use page size 100, so a full first page can prevent their scans from completing while reads continue to succeed. Errors or context cancellation can interrupt the scan.
The existing shared persistence suite checks that both pages contain one row, but does not check their identities or progress. This SQL defect does not require concurrent writes or cluster rename.
Approach
Add a comment where the SQL store produces the cursor and a bounded native SQLite characterization. The test persists two distinct valid cluster records, verifies the second by point read, and demonstrates that the continuation token decodes to an empty cursor and returns the first cluster repeatedly. Its passing assertions document the current defect; a repair should replace them with forward-progress and termination assertions.
Two contained follow-up options are:
cluster_namein the list-specific SELECT projection so the current store can encode the last row's actual ordering key. This is the smaller option and preserves the existing token format and point-read behavior.Neither option is implemented or validated here.
Validation
git diff --check: passed.MySQL and PostgreSQL share the source-level projection defect; they were not exercised against running databases. The test uses bounded page reads and does not start an indefinitely repeating loader or refresher.
Risks, rollout, and scope
This changes comments and tests only. The characterization intentionally asserts the current broken outcome and must change alongside a repair. Cluster mutation consistency, Cassandra pagination, cache eviction confirmation, and namespace rename are outside this candidate.
References