Skip to content

sql: TestStatusAPICombinedStatements is flaky  #69533

@Azhng

Description

@Azhng

It's happening on master. https://teamcity.cockroachdb.com/viewLog.html?buildId=3376012&tab=buildResultsDiv&buildTypeId=Cockroach_UnitTests_Test

My guess is it probably come from here. It's likely a time-related race condition.

In-memory stats gets assigned aggregated_ts when it's returned from the iterator API. The timestamp for in-memory is generated by truncating the current timestamp to nearest hour.

So concretely, suppose we insert stats at 15:43, it will have aggregated_ts = 15:00. If we issue a read with read timestamp at 16:00, and the in-memory stats is not yet flushed to disk, the in-memory stats with be returned with aggregated_ts = 16:00. Hence the test failure.

Solution here would be use the existing testing knobs in SQL stats to stub out the call to timeutil.Now() function to make sure the test is 100% deterministic.

Metadata

Metadata

Assignees

Labels

A-sql-observabilityRelated to observability of the SQL layerC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions