Commit 1d3dc6f
156395: kvserver,storage: recreate long-lived iterators in replica consistenc… r=sumeerbhola a=sumeerbhola
…y check
This capability is enabled by changing the `ComputeStatsVisitors` callbacks to specify a `resumeSoon` bool return value. This is used in `computeStatsForIterWithVisitors` to return before finishing all the work and the returned resumeKey is used in `ComputeStatsWithVisitors` to resume using a new iterator. Similarly, `computeLockTableStatsWithVisitors` uses the resumeSoon to construct new iterators when doing the lock table iteration.
To ensure correctness, the `resumeSoon=true` feature must only be used when the `storage.Reader` returns true from `Reader.ConsistentIterators`, which makes the promise that the different Iterators returned by the `Reader` see the same underlying `Engine` state. The replica consistency check uses a Pebble snapshot, for which the iterators are consistent.
Fixes #154533
Epic: none
Release note: None
158216: sql/inspect: record table version in INSPECT job to detect schema drift r=spilchen a=spilchen
Previously, the INSPECT job only recorded the table IDs involved in the job. However, there is a time gap between when the job record is created and when the job is executed, during which schema changes amy occur. These changes can invalidate assumptions made at job creation (e.g. index ID existence).
This change introduces table version tracking into the job record. Before executing any checks, the job will verify that the current table versions match those stored at creation. If a mismatch is detected, the job will fail early.
This mechanism mirrors similar protections implemented in other jobs, such as TTL jobs.
Informs #158197
Release note: none
158330: kvcoord: add traces to TestUnexpectedCommitOnTxnRecovery r=miraradeva a=stevendanna
We've recently observed a failure in this test that was hard to debug because it appears that the test was running for a long time and then hit an assesrtion failure inside a goroutine.
Here, ensure that we don't fail the test from inside a goroutine and also try to ensure that the test fails a bit more promptly by setting a context timeout.
We've also added traces that should be printed in the case of a failure to help debug what happened.
Informs #158194
Release note: None
Co-authored-by: sumeerbhola <sumeer@cockroachlabs.com>
Co-authored-by: Matt Spilchen <matt.spilchen@cockroachlabs.com>
Co-authored-by: Steven Danna <danna@cockroachlabs.com>
File tree
9 files changed
+549
-193
lines changed- pkg
- jobs/jobspb
- kv
- kvclient/kvcoord
- kvserver
- sql
- importer
- inspect
- storage
9 files changed
+549
-193
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1477 | 1485 | | |
1478 | 1486 | | |
1479 | 1487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
4438 | 4439 | | |
4439 | 4440 | | |
4440 | 4441 | | |
4441 | | - | |
4442 | | - | |
4443 | | - | |
| 4442 | + | |
| 4443 | + | |
4444 | 4444 | | |
4445 | 4445 | | |
4446 | 4446 | | |
| |||
4472 | 4472 | | |
4473 | 4473 | | |
4474 | 4474 | | |
4475 | | - | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
4476 | 4480 | | |
4477 | | - | |
4478 | | - | |
4479 | 4481 | | |
4480 | 4482 | | |
| 4483 | + | |
4481 | 4484 | | |
4482 | | - | |
| 4485 | + | |
4483 | 4486 | | |
4484 | 4487 | | |
4485 | 4488 | | |
4486 | | - | |
4487 | | - | |
| 4489 | + | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
| 4499 | + | |
4488 | 4500 | | |
4489 | | - | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
| 4504 | + | |
| 4505 | + | |
| 4506 | + | |
4490 | 4507 | | |
4491 | 4508 | | |
| 4509 | + | |
4492 | 4510 | | |
4493 | | - | |
4494 | 4511 | | |
4495 | 4512 | | |
4496 | 4513 | | |
4497 | 4514 | | |
4498 | 4515 | | |
4499 | 4516 | | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
4500 | 4532 | | |
4501 | 4533 | | |
4502 | 4534 | | |
4503 | 4535 | | |
4504 | 4536 | | |
4505 | | - | |
4506 | | - | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
4507 | 4544 | | |
4508 | | - | |
4509 | | - | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
4510 | 4553 | | |
4511 | | - | |
4512 | | - | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
4513 | 4557 | | |
4514 | 4558 | | |
4515 | | - | |
4516 | | - | |
4517 | | - | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
4518 | 4569 | | |
4519 | 4570 | | |
4520 | 4571 | | |
4521 | 4572 | | |
4522 | 4573 | | |
4523 | | - | |
4524 | | - | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
4525 | 4577 | | |
4526 | 4578 | | |
4527 | | - | |
| 4579 | + | |
4528 | 4580 | | |
4529 | | - | |
4530 | 4581 | | |
4531 | | - | |
4532 | | - | |
4533 | | - | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
4534 | 4590 | | |
4535 | | - | |
4536 | | - | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
4537 | 4601 | | |
4538 | | - | |
4539 | | - | |
| 4602 | + | |
| 4603 | + | |
4540 | 4604 | | |
4541 | | - | |
4542 | 4605 | | |
4543 | | - | |
| 4606 | + | |
| 4607 | + | |
4544 | 4608 | | |
4545 | 4609 | | |
4546 | 4610 | | |
| |||
4698 | 4762 | | |
4699 | 4763 | | |
4700 | 4764 | | |
4701 | | - | |
4702 | | - | |
| 4765 | + | |
| 4766 | + | |
4703 | 4767 | | |
4704 | 4768 | | |
4705 | 4769 | | |
| |||
4839 | 4903 | | |
4840 | 4904 | | |
4841 | 4905 | | |
4842 | | - | |
4843 | | - | |
| 4906 | + | |
| 4907 | + | |
4844 | 4908 | | |
4845 | 4909 | | |
4846 | 4910 | | |
| |||
0 commit comments