Skip to content

Clarify uncertainty error keys and document randomized anchor key tuning#22814

Open
rmloveland wants to merge 2 commits intomainfrom
20260223-DOC-15172-DOC-14735-randomized-anchor-keys
Open

Clarify uncertainty error keys and document randomized anchor key tuning#22814
rmloveland wants to merge 2 commits intomainfrom
20260223-DOC-15172-DOC-14735-randomized-anchor-keys

Conversation

@rmloveland
Copy link
Contributor

@rmloveland rmloveland commented Feb 23, 2026

Clarify uncertainty error keys and document randomized anchor key tuning

Fixes:

Summary of changes:

  • v25.4 and below, and v26.1 and later:

    • Update ReadWithinUncertaintyIntervalError docs to:
      • Extend the example to include a larger meta={key=/Table/...} fragment
    • Add randomized anchor key tuning guidance to the shared performance/reduce-contention.md
      include:
      • Describe when to consider transaction.randomized_anchor_key.enabled for workloads with
        large concurrent UPDATE/INSERT batches that create transaction record (anchor) hotspots
      • Emphasize that this setting randomizes anchor placement (not user data) to spread txn
        records across ranges
      • In v26.1, tie this guidance to the improved observability: contention events
        and logs already report the actual contention key, so anchor randomization is a
        secondary knob once true conflict locations are understood
  • v25.4 and below only:

    • Update ReadWithinUncertaintyIntervalError docs to:
      • Add an "Interpreting log messages" callout explaining that the logged key is the
        transaction record (anchor) key, not necessarily the actual conflict key
      • Note that SERIALIZATION_CONFLICT contention events recorded when
        sql.contention.record_serialization_conflicts.enabled is true also use this anchor key
  • v26.1 and later only:

    • Update ReadWithinUncertaintyIntervalError docs to:
      • Add an "Interpreting log messages" callout clarifying that in 26.1+ the logged key
        represents the actual contention key, and that earlier versions reported the anchor key
      • Document that contention events now use this contention key when the
        sql.contention.record_serialization_conflicts.enabled setting is enabled
    • Update 'Troubleshoot lock contention' page to include a new section on using randomized
      anchor keys

@rmloveland rmloveland marked this pull request as draft February 23, 2026 20:55
@netlify
Copy link

netlify bot commented Feb 23, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit ee10154
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/699e08b3a68d6c0008462822

@netlify
Copy link

netlify bot commented Feb 23, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit ee10154
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/699e08b3c60ca50008ddd1d6

@netlify
Copy link

netlify bot commented Feb 23, 2026

Netlify Preview

Name Link
🔨 Latest commit ee10154
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/699e08b38830070008822bba
😎 Deploy Preview https://deploy-preview-22814--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rmloveland rmloveland force-pushed the 20260223-DOC-15172-DOC-14735-randomized-anchor-keys branch 2 times, most recently from c2829cd to 1ada635 Compare February 24, 2026 16:20
@rmloveland rmloveland marked this pull request as ready for review February 24, 2026 16:20
@rmloveland rmloveland force-pushed the 20260223-DOC-15172-DOC-14735-randomized-anchor-keys branch from 1ada635 to 8988c8a Compare February 24, 2026 16:35
Fixes:

- DOC-14735
- DOC-15172

Summary of changes:

- v25.4 and below, and v26.1 and later:

  - Update ReadWithinUncertaintyIntervalError docs to:
    - Extend the example to include a larger `meta={key=/Table/...}` fragment
  - Add randomized anchor key tuning guidance to the shared `performance/reduce-contention.md`
    include:
    - Describe when to consider `transaction.randomized_anchor_key.enabled` for workloads with
      large concurrent UPDATE/INSERT batches that create transaction record (anchor) hotspots
    - Emphasize that this setting randomizes anchor placement (not user data) to spread txn
      records across ranges
    - In v26.1, tie this guidance to the improved observability: contention events
      and logs already report the actual contention key, so anchor randomization is a
      secondary knob once true conflict locations are understood

- v25.4 and below only:

  - Update ReadWithinUncertaintyIntervalError docs to:
    - Add an "Interpreting log messages" callout explaining that the logged key is the
      transaction record (anchor) key, not necessarily the actual conflict key
    - Note that SERIALIZATION_CONFLICT contention events recorded when
      `sql.contention.record_serialization_conflicts.enabled` is true also use this anchor key

- v26.1 and later only:

  - Update ReadWithinUncertaintyIntervalError docs to:
    - Add an "Interpreting log messages" callout clarifying that in 26.1+ the logged key
      represents the actual contention key, and that earlier versions reported the anchor key
    - Document that contention events now use this contention key when the
      `sql.contention.record_serialization_conflicts.enabled` setting is enabled
  - Update 'Troubleshoot lock contention' page to include a new section on using randomized
    anchor keys
@rmloveland rmloveland force-pushed the 20260223-DOC-15172-DOC-14735-randomized-anchor-keys branch from 8988c8a to db794d9 Compare February 24, 2026 16:38
@rmloveland
Copy link
Contributor Author

@arulajmani pinged you for review since this came out of your KV on-call a while ago (details in https://cockroachlabs.atlassian.net/browse/DOC-15172)

@angles-n-daemons pinging you since we discussed your changes to the txn record key in v26.1 and later in Slack (docs issue is https://cockroachlabs.atlassian.net/browse/DOC-14735)

cc @michae2, i already asked @angles-n-daemons to review the txn record key stuff, but FYI this closes out DOC-14735 which was prompted by you answering a q in slack a long time ago :-)

Copy link

@angles-n-daemons angles-n-daemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the changes, looks good on my side :)

Copy link

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

3 participants