Skip to content

A table's scanInterval is not saved, so only the declaring thread uses it #4241

Open

Description

@kriszyp

Summary

A table's scanInterval is validated when a declaration names it, but it is not saved on the catalog row. Only the thread that declared it uses it; threads that load the table from the catalog, and the declaring thread after a restart until its declaration runs again, scan at the derived cadence ((expiration + eviction) / 4).

Mechanism

  • persistTableSettings in resources/databases.ts writes and clears expiration and eviction, not scanInterval.
  • setTTLExpiration's object form replaces scanInterval with whatever the declaration passed, so a re-declaration that omits it resets it to the derived cadence on that thread.

For a schema-declared table this is mostly invisible, since every worker declares the table at startup. It shows for tables created at runtime (create_table does not take scanInterval) and for tables whose declaration runs on one thread only. Noted as accepted on #2831; filed so the decision is tracked.

Expected

Either save scanInterval with the other TTL settings (and adopt it like them), or document it as a per-declaration setting.

Review-Deferral: 0e0e0e216a2a71a6 severity=nit category=maintainability

🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @kriszyp.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions