Commit 6f231fe
committed
backup: accept unknown manifest fields for same-major evolution (PR #712, round 3)
Codex P1 #205 (round 2): DisallowUnknownFields broke the
documented same-major minor-evolution path. A newer producer
that adds an optional field at the same format_version turns
older readers into hard read failures during mixed-version
operation, even though both nodes are on the "same major" by
contract.
The format_version field IS the breaking-change signal. Major
bumps are gated by ErrUnsupportedFormatVersion; same-major
minor evolution must silently tolerate optional new fields.
Removed dec.DisallowUnknownFields() from ReadManifest. Replaced
TestReadManifest_RejectsUnknownFields with
TestReadManifest_AcceptsUnknownFieldsForSameMajorMinorEvolution.
The trailing-bytes guard (dec.More() check) is preserved -- it
catches concatenation bugs which is a different concern from
optional-field tolerance.1 parent e4cd7d8 commit 6f231fe
2 files changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
147 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
161 | | - | |
| 164 | + | |
162 | 165 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| |||
0 commit comments