Repository navigation
Seed the restart-row index plan test on a fixed day - #5065
Merged
Merged
Conversation
Seed at a fixed past instant so the newest chunk is a full day, guard its row count, and print the plan on failure.
erikdarlingdata
marked this pull request as ready for review
October 4, 2026 02:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What failed and when
RestartRowIndexLiveTests.EachReader_PlansOnItsPartialIndex_OnAnUncompressedChunk_AndReturnsExactlyTheRestartRowsfailed in the 01:20 UTC nightly:Assert.Empty() Failure: Collection was not empty Collection: ["Seq Scan on _hyper_29_2_chunk"].Cause
The seed gives each of its 5,000 rows a time
gseconds before the real wall clock, so it covers the last 83 minutes. Chunks are one day, aligned to UTC midnight. Between 00:00 and about 01:23 UTC the seed therefore lands on two daily chunks. In the 01:20 run, the older chunk held about 200 rows, and on a chunk that small a Seq Scan costs less than the partial index, so the no-heap-scan assertion failed. The same defect was fixed for the legacy-row test in #5061.Fix (test only)
collect.query_statsandcollect.procedure_stats(the seed sits in one daily chunk), and still requires at least 1,000 rows.Test plan
RestartRowIndexLiveTestsrun 3 times, 3/3 passed each time.TuningStartPathOneBuildTests5/5 andQueryStoreLegacyRowIndexLiveTests2/2 passed. Darling.Tests builds with 0 warnings, 0 errors.collect.query_stats has 3200 seeded rows before 2026-01-16; the seed must sit inside one daily chunk; with the anchor at 2026-01-16 01:20 it failed withcollect.query_stats has 200 seeded rows before 2026-01-16; the seed must sit inside one daily chunk.Other live plan tests seeded from the wall clock
Census:
Darling/Darling.Tests/*LiveTests.csfiles that both useDateTime.UtcNowand assert on a plan. I read the seed lines only, not every test body. Only this class is changed.AnomalyObjectStatsLatestSnapshotsLiveTests.cs:72-73(EXPLAIN at :114): seeds a snapshot at now and one at now-2 days. Rows are few; chunk placement near midnight could vary. Possible.StoreMetricsLatestSkipScanLiveTests.cs:82(plan assertion near :133): a month of hourly history ending at now, 720 rows per object. The newest chunk can be small just after midnight. Possible.QueryStoreBackgroundIndexesLiveTests.cs:196(Assert.DoesNotContain("Seq Scan", ...)at :286): reads end at now. Possible if its seed also ends at now; not checked.DarlingWatermarkFloorPlanShapeLiveTests.cs:83: 30 days of daily rows from now. One row per day, so the span crosses midnight by design; the assertion is a bounded chunk count, not a Seq Scan check.JobHistoryPerServerTopNLiveTests.cs:202,258,416andJobHistoryWatermarkEpochLiveTests.cs:160,161,212: seeds from now back hours to days; spans cross midnight by design. Their plan assertions are Index Scan and no extra Sort, which do not depend on chunk size as far as I read.CollectionLogSegmentByLiveTests.cs:95,162,463,ParameterSensitiveDrillDownTextLiveTests.cs:174,PlanRegressionDrillDownReuseLiveTests.cs:88,TopCpuQueriesTextLiveTests.cs:143: a 4-hour window ending now (the last four); it crosses midnight for the first 4 hours of each UTC day. They use EXPLAIN ANALYZE plan inspection; whether the assertion is chunk-size sensitive was not checked.QueryStoreBackfillCutChunkLiveTests.cs:215: already waits until the floor is clear of midnight, so it is safe.PlanSync4530*LiveTests.cs,PgPlanCapture*LiveTests.cs: "Index Scan" there is plan XML text or a single stamp, not a planner choice. Not at risk.QueryStoreBackfillCandidateLiveTests.cs: uses a fixed anchor already.CHANGELOG entry
None: test-only change.
SECTION: None