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: apply PCR AOST time stamp for authentication flow #135929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Nov 21, 2024

Previously, when using PCR reader catalog its was possible to hit "PCR reader timestamp has moved forward" when attempting to execute workloads. This was because internal executors are exempt from the AOST timestamp. To address this, the authentication code paths are updated to set fixed timestamps, when connecting to a PCR reader catalog. Additionally, additional tests are added for validating opening new connections and preparing queries to confirm this problem is fixed.

Fixes: #135829

Release note: None

Previously, when using PCR reader catalog its was possible to hit "PCR
reader timestamp has moved forward" when attempting to execute
workloads. This was because internal executors are exempt from the AOST
timestamp. To address this, the authentication code paths are updated to
set fixed timestamps, when connecting to a PCR reader catalog.
Additionally, additional tests are added for validating opening new
connections and preparing queries to confirm this problem is fixed.

Fixes: cockroachdb#135829

Release note: None
@fqazi fqazi requested a review from msbutler November 21, 2024 18:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@fqazi fqazi marked this pull request as ready for review November 21, 2024 18:57
@fqazi fqazi requested a review from a team as a code owner November 21, 2024 18:57
Copy link
Collaborator

@msbutler msbutler 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 patch!! I'll try running my roachtest on top of this. I'll let someone from foundations approve this.

One other thought: I wonder if there's a more general way to find other internal executor read queries that require a fixed timestamp. Or maybe this points to a larger design problem: perhaps no system tables should be externalized. cc @dt

@@ -322,6 +328,16 @@ func TestReaderCatalogTSAdvance(t *testing.T) {
} else {
require.NotEqualValues(t, srcRes, destRes)
}

// Sanity: Execute the same query as prepared statement inside the reader
Copy link
Collaborator

Choose a reason for hiding this comment

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

to confirm, were these unit tests with prepared stmts failing before your patch to the source code?

@@ -432,7 +473,7 @@ func TestReaderCatalogTSAdvance(t *testing.T) {
// with PCR even if a long running txn is running.
func TestReaderCatalogTSAdvanceWithLongTxn(t *testing.T) {
defer leaktest.AfterTest(t)()
skip.UnderDuress(t)
// skip.UnderDuress(t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: intended?

@msbutler msbutler requested a review from dt November 21, 2024 22:34
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.

crosscluster/physical: prepared statement evaluation fails in read from standby workload
3 participants