You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
155549: kvstorage: make replica destruction always sorted r=arulajmani a=pav-kv
This PR refactors replica destruction helpers in `kvstorage` (`DestroyReplica` and `SubsumeReplica`) so that they always generate storage writes ordered by engine key. This is to support the most restrictive user of `SubsumeReplica`: `prepareSnapApply` feeds these writes into SSTables (which assert on the keys order), part of snapshot ingestion path.
Other byproducts of this PR:
- `ClearRangeData` and its options are removed due to being redundant and not flexible.
- A decision is made to split the unreplicated RangeID-local keyspace into "state machine" and "raft", separated by the `RangeTombstone` key. This leaves us with only one exception: `RaftReplicaID` key in the middle of the "raft" keyspace is said to be a "state machine" key. We can migrate it to the correct half later, together with other storage migrations.
- The loop unwinding in `destroyReplicaImpl` brings us very close to logical separation of engines in this function. We now only need to handle the `RaftReplicaID` key correctly.
- The heuristic from `ClearRangeWithHeuristic` is now always used with the same threshold. There are no forced `ClearRawRange`s in the snapshot path anymore, unless opted in by tests.
Related to #152845
156334: sql: add read/write metrics r=yuzefovich a=andy-kimball
### sql: add index_bytes_written metric
Add new `sql.statements.index_bytes_written.count` metric that counts the number
of primary and secondary index bytes modified by SQL statements.
### sql: add index_rows_written metric
Add new `sql.statements.index_rows_written.count` metric that counts the number
of primary and secondary index rows modified by SQL statements.
### sql: add bytes_read metric
Add new `sql.statements.bytes_read.count` metric that counts the number of
bytes scanned by SQL statements. This is the same value that's collected by
SQL stats for each statement and transaction, except in aggregated metric
form.
Co-authored-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
0 commit comments