Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: introduce preliminary support for savepoints #43051

Closed
wants to merge 2 commits into from

Commits on Feb 15, 2020

  1. sql: separate metrics for restart and non-restart savepoints

    Release note (sql change): CockroachDB now collects separate sets of
    metrics for usage of SAVEPOINT: one set for regular SQL savepoints and
    one set for uses dedicated to CockroachDB's client-side transaction
    retry protocol.
    knz committed Feb 15, 2020
    Configuration menu
    Copy the full SHA
    7d76bdc View commit details
    Browse the repository at this point in the history
  2. sql: preliminary executor logic for savepoints

    This commit introduces support for regular SQL savepoints in the
    executor.
    
    The following is supported:
    
    - recognizing the SAVEPOINT / ROLLBACK TO SAVEPOINT / RELEASE
      SAVEPOINT statements even when the savepoint name is not
      "cockroach_restart".
    - maintaining a list of current active savepoints, and detect
      when SAVEPOINT and RELEASE/ROLLBACK are mismatched.
    - issue the `GetSavepoint()` / `RollbackToSavepoint()` /
      `ReleaseSavepoint()` API calls to the KV layers.
    - enforce that `cockroarch_restart` (and retry savepoints in general)
      are not started "under" a regular savepoint.
    
    What is not supported yet:
    
    - Rejecting ROLLBACK after a DDL statement has executed.
    - ROLLBACK when the txn is aborted (i.e. after an error).
    
    Release note (sql change): CockroachDB now provides
    rudimentary (incomplete) and experimental support for SQL savepoints.
    
    Release note (sql change): CockroachDB supports a new statement `SHOW
    SAVEPOINT STATUS` which reveals the current stack of active
    savepoints. This can be used to teach savepoint usage.
    knz committed Feb 15, 2020
    Configuration menu
    Copy the full SHA
    69533b3 View commit details
    Browse the repository at this point in the history