Commit dd0beb2
committed
docs(encryption): PR893 round-1 — gemini HIGH (wrapOnPropose startup init) + 2 mediums
gemini HIGH on §2.1 (line 57)
The original spec said wrapOnPropose is 'set by the cutover
barrier and never reset within a process lifetime' but did
not specify how the flag is initialized on startup. A node
that restarts AFTER the cluster has cut over would default
the flag to false, propose plaintext as a new leader, and
the engine apply-hook (which uses the sidecar — NOT the
in-process flag — as the source of truth) would attempt
Unwrap on those plaintext entries, fail GCM, and halt apply
cluster-wide.
Fix: §2.1 now requires the flag to be initialized to true
iff sidecar.RaftEnvelopeCutoverIndex != 0 at coordinator
construction time. Two set-paths total (startup hydration,
barrier step 5) and zero reset-paths within a process load.
Added test TestCoordinatorWrap_StartupInitFromSidecar in
§6.2 to pin the regression.
gemini MEDIUM on §2.4 (line 143)
applyNormalEntry signature in the proposed code snippet did
not match the actual codebase. Verified at
internal/raftengine/etcd/engine.go:2226 that the real
signature is (entry raftpb.Entry) (any, error); setApplied
and resolveProposal live in applyNormalCommitted (line 2173,
2186-2187) which calls applyNormalEntry. Updated the
snippet + commentary to match: 6E-2 adds the unwrap shim
inside applyNormalEntry without changing the caller
contract; the error return is what makes
applyNormalCommitted skip setApplied (the existing
fail-closed shape).
gemini MEDIUM on §5 header (line 268)
Header said 'is unwrapped' but the body says 'is NOT
unwrapped'. Header was a typo. Now reads 'NOT unwrapped'.
Self-review (5-lens) on the doc change itself:
1. Data loss — startup-init rule directly prevents the
halt-apply-cluster-wide scenario that the original spec
left open.
2. Concurrency — the flag has two write paths (startup
hydration on a single goroutine, barrier step 5 on a
single goroutine), both serial; no race possible within
the lifetime of one process load.
3. Performance — startup-init is a single sidecar read at
coordinator construction (already happens for 6C-2);
zero hot-path cost.
4. Data consistency — the engine apply-hook still reads
the sidecar as the source of truth (per-replica
deterministic); the in-process flag is the leader's
write-side mirror, not a parallel decision oracle.
5. Test coverage — new test pinned; without it the gemini
HIGH scenario would regress silently.1 parent 5259d23 commit dd0beb2
1 file changed
Lines changed: 57 additions & 18 deletions
Lines changed: 57 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
60 | 78 | | |
61 | 79 | | |
| |||
111 | 129 | | |
112 | 130 | | |
113 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
114 | 143 | | |
115 | 144 | | |
116 | | - | |
| 145 | + | |
117 | 146 | | |
118 | 147 | | |
119 | | - | |
| 148 | + | |
120 | 149 | | |
121 | 150 | | |
122 | 151 | | |
| |||
129 | 158 | | |
130 | 159 | | |
131 | 160 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
138 | 167 | | |
139 | 168 | | |
140 | | - | |
141 | | - | |
142 | | - | |
| 169 | + | |
143 | 170 | | |
144 | 171 | | |
145 | 172 | | |
146 | 173 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
151 | 180 | | |
152 | 181 | | |
153 | 182 | | |
| |||
265 | 294 | | |
266 | 295 | | |
267 | 296 | | |
268 | | - | |
| 297 | + | |
269 | 298 | | |
270 | 299 | | |
271 | 300 | | |
| |||
330 | 359 | | |
331 | 360 | | |
332 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
333 | 372 | | |
334 | 373 | | |
335 | 374 | | |
| |||
0 commit comments