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

roachtest: schemachange/mixed-versions failed [attempting to append refresh spans after the tracked timestamp has moved forward] #122955

Closed
cockroach-teamcity opened this issue Apr 24, 2024 · 4 comments
Labels
branch-release-23.2.5-rc C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Apr 24, 2024

roachtest.schemachange/mixed-versions failed with artifacts on release-23.2.5-rc @ e7576d10aaaa61940cebf8bd8f157ce0e1651e7b:

(mixedversion.go:592).Run: mixed-version test failure while running step 17 (run "run schemachange workload and validation in mixed version"): full command output in run_061857.471987998_n4_COCKROACHRANDOMSEED6.log: COMMAND_PROBLEM: exit status 1
test artifacts and logs in: /artifacts/schemachange/mixed-versions/run_1

Parameters:

  • ROACHTEST_arch=amd64
  • ROACHTEST_cloud=gce
  • ROACHTEST_coverageBuild=false
  • ROACHTEST_cpu=4
  • ROACHTEST_encrypted=false
  • ROACHTEST_metamorphicBuild=false
  • ROACHTEST_ssd=0
Help

See: roachtest README

See: How To Investigate (internal)

See: Grafana

Same failure on other branches

/cc @cockroachdb/sql-foundations

This test on roachdash | Improve this report!

Jira issue: CRDB-38291

@cockroach-teamcity cockroach-teamcity added branch-release-23.2.5-rc C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Apr 24, 2024
@cockroach-teamcity cockroach-teamcity added this to the 23.2 milestone Apr 24, 2024
@annrpom
Copy link
Contributor

annrpom commented Apr 24, 2024

 "message": "***UNEXPECTED ERROR; Failed to generate a random operation: ... []: ERROR: 
internal error: attempting to append refresh spans after the tracked timestamp has moved forward. batchTimestamp: 
1713939553.051103790,0 refreshedTimestamp: 1713939553.485973655,1 (SQLSTATE XX000)",


"query": "WITH database_id AS (SELECT id FROM system.namespace WHERE ((\"parentID\" = 0) AND (\"parentSchemaID\" 
= 0)) AND (name = current_database())), schema_id AS (SELECT nsp.id FROM system.namespace AS nsp JOIN database_id 
ON ((\"parentID\" = database_id.id) AND (\"parentSchemaID\" = 0)) AND (name = $1)), descriptor_ids AS (SELECT nsp.id 
FROM system.namespace AS nsp, schema_id, database_id WHERE (nsp.\"parentID\" = database_id.id) AND 
(nsp.\"parentSchemaID\" = schema_id.id)), descriptors AS (SELECT 
crdb_internal.pb_to_json('cockroach.sql.sqlbase.Descriptor', descriptor) AS descriptor FROM system.descriptor AS 
descriptors JOIN descriptor_ids ON descriptors.id = descriptor_ids.id), types AS (SELECT descriptor FROM descriptors 
WHERE (descriptor-\u003e'type') IS NOT NULL), table_references AS (SELECT json_array_elements((descriptor-
\u003e'table')-\u003e'dependedOnBy') AS ref FROM descriptors WHERE (descriptor-\u003e'table') IS NOT NULL), 
dependent AS (SELECT (ref-\u003e\u003e'id')::INT8 AS id FROM table_references), referenced_descriptors AS (SELECT 
json_array_elements_text((descriptor-\u003e'type')-\u003e'referencingDescriptorIds')::INT8 AS id FROM types) SELECT 
EXISTS (SELECT * FROM system.namespace WHERE ((id IN (SELECT id FROM referenced_descriptors)Error: 
***UNEXPECTED ERROR; Failed to generate a random operation: Collect: CollectRows: "WITH \"descriptors\" AS 
(SELECT\n\t\tdescriptor.id,\n\t\t\"parentSchemaID\" AS schema_id,\n\t\tnamespace.name AS 
name,\n\t\tcrdb_internal.pb_to_json('desc', descriptor) AS descriptor\n\tFROM system.descriptor\n\tJOIN 
system.namespace ON namespace.id = descriptor.id\n\tWHERE \"parentID\" = (SELECT id FROM system.namespace WHERE 
name = current_database() AND \"parentID\" = 0)\n\t),\n\"enums\" AS (SELECT id, schema_id, name, descriptor->'type' AS 
descriptor FROM descriptors WHERE descriptor ? 'type'),\n\"enum_members\" AS (SELECT *, 
jsonb_array_elements(descriptor->'enumMembers') AS member FROM 
enums)\nSELECT\n\t\t\t\tquote_ident(schema_id::REGNAMESPACE::TEXT) || '.' || quote_ident(name) AS 
name,\n\t\t\t\tquote_literal(member->>'logicalRepresentation') AS value,\n\t\t\t\tCOALESCE(member->>'direction' = 
'REMOVE', false) AS dropping,\n\t\t\t\tCOALESCE(json_array_length(descriptor->'referencingDescriptorIds') > 0, false) AS 
has_references\n\t\t\tFROM enum_members\n\t" []: ERROR: internal error: attempting to append refresh spans after the 
tracked timestamp has moved forward. batchTimestamp: 1713939553.051103790,0 refreshedTimestamp: 
1713939553.485973655,1 (SQLSTATE XX000)

@rafiss rafiss changed the title roachtest: schemachange/mixed-versions failed roachtest: schemachange/mixed-versions failed [attempting to append refresh spans after the tracked timestamp has moved forward] Apr 24, 2024
@rafiss rafiss added T-kv KV Team and removed T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Apr 24, 2024
@rafiss
Copy link
Collaborator

rafiss commented Apr 24, 2024

The error comes from here:

// assertRefreshSpansAtInvalidTimestamp returns an error if the timestamp at
// which a set of reads was performed is below the largest timestamp that this
// transaction has already refreshed to.
func (sr *txnSpanRefresher) assertRefreshSpansAtInvalidTimestamp(
readTimestamp hlc.Timestamp,
) error {
if readTimestamp.Less(sr.refreshedTimestamp) {
// This can happen with (illegal) concurrent txn use, but that's supposed to
// be detected by the gatekeeper interceptor.
return errors.AssertionFailedf("attempting to append refresh spans after the tracked"+
" timestamp has moved forward. batchTimestamp: %s refreshedTimestamp: %s",
errors.Safe(readTimestamp), errors.Safe(sr.refreshedTimestamp))
}
return nil
}

According to the comment, the gatekeeper interceptor should detect this error, but it looks like that isn't working, so checking if KV has any ideas why.

@nvanbenschoten
Copy link
Member

See discussion on #122274. This is an indication that a RootTxn is used while there are outstanding LeafTxns. Maybe in the REGNAMESPACE cast, which I believe uses an internal executor in planner.ResolveOIDFromOID.

@yuzefovich
Copy link
Member

closing as a dup of #122274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-23.2.5-rc C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-queries SQL Queries Team
Projects
Archived in project
Status: Incoming
Status: Done
Development

No branches or pull requests

5 participants