Skip to content

fix(catalog): a filtered listing keeps reading until its page is full, also for generic tables - #2304

Merged
c-thiel merged 1 commit into
mainfrom
ct/generic-table-list-page-token
Nov 15, 2026
Merged

c-thiel merged 1 commit into
mainfrom
ct/generic-table-list-page-token

Conversation

@c-thiel

@c-thiel c-thiel commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

When a user may not see some entries, a listing keeps reading until the page is full.

  • Tables, views, namespaces and soft-deleted tabulars: a listing could stop too early when the page size was above the default page size (100) and more of the first read was hidden than one further read returns. The response then had fewer entries than the page size and no next-page token, so the client never saw the remaining entries. A listing now ends without a next-page token only when the database has no more rows. Iceberg clients that send neither a page token nor a page size get up to 1,000 entries (the default maximum) on their first request, so a client such as PyIceberg could miss entries.
  • Generic tables: a listing filtered one database page and returned that page's next-page token. A page could come back short or empty while still carrying a token, and the token could name a generic table the user may not see (its id and creation time). Generic-table listings now work like the others: pages are full, and the token belongs to the last returned entry. A last page that is not full has no next-page token. An empty pageToken starts at the first page (it returned 400).

The shared pagination tests gain a case that hides more rows than one further read returns. It failed for every listing before this change. The tests now also run for generic tables.

Downstream follow-up

CatalogStore::list_generic_tables_impl and CatalogGenericTableOps::list_generic_tables return PaginatedMapping<GenericTableId, GenericTableListEntry>, with one page token per row. Plus does not call or implement them; no action needed.

Summary by CodeRabbit

  • Bug Fixes
    • Generic table listings now paginate correctly when some entries are hidden by access controls, filling pages with visible entries where possible.
    • Listings no longer provide a next-page token when there are no more results, including when hidden entries extend beyond the final visible result.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Generic-table listing now returns paginated mappings. The server fetches and authorizes catalog pages until it fills a response or reaches the end of the data. Shared and endpoint tests cover hidden entities, page ordering, and continuation-token behavior.

Changes

Generic-table pagination

Layer / File(s) Summary
Paginated mapping contract and storage
crates/lakekeeper/src/service/catalog_store/generic_table.rs, crates/lakekeeper/src/service/catalog_store.rs, crates/lakekeeper-storage-postgres/src/catalog.rs, crates/lakekeeper-storage-postgres/src/tabular/generic_table.rs
Generic-table listing now returns a PaginatedMapping keyed by table ID. Storage creates a token for each row from its creation time and ID. The storage pagination test follows the returned tokens.
Authorized page fetching and response
crates/lakekeeper/src/server/mod.rs, crates/lakekeeper/src/server/generic_tables/list.rs
The list handler fetches pages and authorizes each page. The shared fetch loop continues through full reads that contain denied rows and ends pagination on a short read. The handler builds the response from approved entries and the resulting token.
Shared and endpoint pagination tests
crates/lakekeeper-integration-tests/src/pagination_macro.rs, crates/lakekeeper-integration-tests/tests/integration/server_generic_tables.rs, tests/integration-tests/lance/test_lance.py
Shared tests cover 304 entities with 0–100 hidden and verify ordered results across two pages. Generic-table tests assert three ordered pages and configure hidden table ranges. The Lance listing test expects no next-page token.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant GenericTableListHandler
  participant fetch_until_full_page
  participant CatalogStore
  participant authorize_page
  GenericTableListHandler->>fetch_until_full_page: fetch and authorize generic-table pages
  loop Each fetched page
    fetch_until_full_page->>CatalogStore: list_generic_tables with page token
    CatalogStore-->>fetch_until_full_page: paginated mapping of entries and tokens
    fetch_until_full_page->>authorize_page: authorize page entries
    authorize_page-->>fetch_until_full_page: authorization results
  end
  fetch_until_full_page-->>GenericTableListHandler: approved entries and next-page token
Loading
Merge Risk: Minimal · up to 8722b

Generic-table listings now fill pages and omit the next-page token only at the end of the data, matching the other listings. No concrete merge-blocking risk was identified; the tests cover the main scenarios.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: filtered listings keep reading until the page is full, and the same fix applies to generic tables. The raw summary and objectives confirm that the changeset implements…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: filtered listings keep reading until the page is full, and the same fix applies to generic tables. The raw summary and objectives confirm that the changeset implements this fill-page behavior in the shared fetch logic and the generic-table listing path, and adds shared pagination tests. The title uses the conventional commit form and is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the pages in a row,
And watches hidden table names go.
Full pages bring the next request,
Short pages say the end is best.
“The tokens line up, the order is right!”
I thump my paws and hop tonight.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f989130-5dd3-4094-95ca-13877c3fa555
Commits

Reviewing files that changed from the base of the PR and between f4abcc8 and 8722b4f.

Files selected for processing: 1

  • crates/lakekeeper-integration-tests/tests/integration/server_generic_tables.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 14, 2026
…, also for generic tables

A listing of tables, views, namespaces or soft-deleted tabulars could stop early, without a next-page token, when more of the first read was hidden than one further read returns. It now ends only when the database has no more rows.

Generic-table listings use the same path: full pages, and a next-page token that belongs to the last returned entry.
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR match the correct format. Thank you!

@c-thiel
c-thiel merged commit 9fdf047 into main Nov 15, 2026
87 checks passed
@c-thiel
c-thiel deleted the ct/generic-table-list-page-token branch November 15, 2026 10:33
c-thiel added a commit that referenced this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant