Skip to content

SchemaStore shutdown may exceed the graceful timeout during snapshot initialization #6333

Description

@lidezhu

What did you do?

CI failure: https://prow.tidb.net/jenkins/job/pingcap/job/ticdc/job/pull_cdc_storage_integration_heavy_next_gen_legacy_safepoint/340/stages/

During shutdown, SchemaStore.Close may wait for RegisterKeyspace to release keyspaceLocker while it is initializing or retrying a schema snapshot. The initialization was not canceled by the SchemaStore lifecycle, so shutdown could exceed the 30-second graceful timeout.

The encrypted snapshot path also used context.Background() and log.Fatal, preventing cancellation and potentially terminating the process on normal shutdown.

What did you expect to see?

  • Cancel in-progress keyspace initialization before waiting for keyspaceLocker.
  • Reject keyspace registration after SchemaStore.Close.
  • Propagate cancellation through schema/table encryption.
  • Return encryption and cancellation errors instead of calling log.Fatal.

What did you see instead?

As described above

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

(paste TiCDC version here)

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions