Commit 9c743dc
catalog: fix review issues for cluster replica sizes
Address blocking code review feedback:
1. **Structured errors**: Replace `AdapterError::Unstructured(anyhow!(...))` with
proper error variants:
- `ErrorKind::ClusterReplicaSizeInUse` for in-use drop attempts
- `ErrorKind::ReadOnlyClusterReplicaSize` for builtin drop attempts
2. **Audit log entries**: Add audit log events for CREATE and DROP
CLUSTER REPLICA SIZE operations using `EventType::Create`/`Drop`
with `ObjectType::ClusterReplicaSize`. Add the new variant to the
audit log `ObjectType` enum and proto serialization.
3. **In-use safety on builtin sync**: When a size is removed from the
env var but may still be referenced by existing replicas, mark it
as `disabled: true` instead of deleting. This prevents panics in
`concretize_replica_location` which expects all referenced sizes
to exist in the catalog.
4. **Doc comment on PartialEq**: Document that the manual PartialEq
impl on ClusterReplicaSize ignores the allocation field, and
explain why and how to compare allocations correctly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent cb2ed86 commit 9c743dc
10 files changed
Lines changed: 66 additions & 13 deletions
File tree
- src
- adapter/src
- catalog
- coord/sequencer
- audit-log/src
- catalog-protos
- src
- catalog/src
- durable
- memory
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | | - | |
1165 | | - | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1166 | 1168 | | |
| 1169 | + | |
| 1170 | + | |
1167 | 1171 | | |
| 1172 | + | |
1168 | 1173 | | |
1169 | 1174 | | |
1170 | 1175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
1719 | | - | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1720 | 1734 | | |
1721 | 1735 | | |
1722 | 1736 | | |
1723 | 1737 | | |
1724 | 1738 | | |
1725 | 1739 | | |
1726 | 1740 | | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
| 1741 | + | |
| 1742 | + | |
1730 | 1743 | | |
1731 | 1744 | | |
1732 | 1745 | | |
| |||
1738 | 1751 | | |
1739 | 1752 | | |
1740 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1741 | 1768 | | |
1742 | 1769 | | |
1743 | 1770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
949 | 952 | | |
950 | 953 | | |
951 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2495 | 2495 | | |
2496 | 2496 | | |
2497 | 2497 | | |
| 2498 | + | |
2498 | 2499 | | |
2499 | 2500 | | |
2500 | 2501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2495 | 2495 | | |
2496 | 2496 | | |
2497 | 2497 | | |
| 2498 | + | |
2498 | 2499 | | |
2499 | 2500 | | |
2500 | 2501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
0 commit comments