Skip to content

Conversation

@sidhdirenge
Copy link
Contributor

@sidhdirenge sidhdirenge commented Dec 24, 2025

This PR addresses Cloud Spanner lock contention issues encountered in 6.11 instances. The contention was primarily driven by high-frequency SELECT COUNT(*) queries on the run_records table used for flow control. These read queries acquired locks to the table as they were executed as part of ReadWriteTransaction (reference).

Changes:

  1. Introduced new QueryOption interface & one of its implementation (StaleReadsOption)
  2. StructuredTable.count() method that accepts these QueryOptions.
  3. Flow Control service calls the new count method via AppMetaStore. The max staleness is decided based on cConf property.

Testing:

  • CDAP Distributed docker image
  • Load test with concurrent launch of 1000 runs.

@sidhdirenge sidhdirenge added the build Triggers github actions build label Dec 24, 2025
@sidhdirenge sidhdirenge changed the title CDAP-21223 Fix Cloud Spanner lock contention issues related to count() query [CDAP-21223] Fix Cloud Spanner lock contention issues related to count() query Dec 24, 2025
@sidhdirenge sidhdirenge force-pushed the sidhdirenge-spanner-lock-1 branch from f4aa558 to 7aa8a6b Compare December 26, 2025 12:05
@sidhdirenge sidhdirenge requested a review from vsethi09 December 26, 2025 12:06
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
30.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sidhdirenge sidhdirenge merged commit 09f11b6 into develop Dec 28, 2025
12 of 13 checks passed
@sidhdirenge sidhdirenge deleted the sidhdirenge-spanner-lock-1 branch December 28, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Triggers github actions build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants