Commit 6291a2d
fix(satellite): decouple rs-discard-granularity from discard-zeroes gating (#112)
* fix(satellite): decouple rs-discard-granularity from discard-zeroes gating
A partially-written FILE_THIN volume resynced ~2x the bytes upstream
LINSTOR did because the rendered .res lacked rs-discard-granularity.
autoDiskOptions() early-returned nil for any provider that was not
discard-zeroes-safe, coupling rs-discard-granularity (which upstream
gates ONLY on the backing device's reported discard granularity) to
discard-zeroes-if-aligned (correctly provider-gated).
Decouple the two gates to mirror upstream:
- discard-zeroes-if-aligned: provider-gated as before, but now
rendered explicitly as `no` for non-safe kinds (FILE_THIN, thick
LVM, FILE) instead of omitting the whole block — matching upstream
1.33.2's render.
- rs-discard-granularity: emitted whenever the backing device reports
a non-zero discard granularity (lsblk DISC-GRAN > 0), independent of
provider kind, so an aligned all-zero region is UNMAPped during
resync instead of transferred.
Multi-volume collapse stays conservative: discard-zeroes-if-aligned is
`yes` only when every volume is safe (one `no` pins the resource), and
rs-discard-granularity is the smallest across volumes.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
* test(corner-q3): pin FILE_THIN rs-discard-granularity at L6 + L7
L6 cli-matrix cell file-thin-rs-discard-granularity.sh: 512M FILE_THIN
single replica, write 320M, add 2nd diskful replica, assert the new
replica's resync `received` byte counter is close to the written bytes
(not the full device) and the rendered .res carries the discard disk
block.
L7 replay file-thin-rs-discard-granularity.yaml: operator-CLI sequence
asserting the rendered DRBD config carries rs-discard-granularity=4096
and discard-zeroes-if-aligned=no for a FILE_THIN resource, plus a clean
3rd-replica sync (drbd_option + sync_clean awaits).
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
* docs(cli-parity): record FILE_THIN disk-block render deltas (Q3 #76)
After the rs-discard-granularity decoupling fix, BS renders the same
thin-aware-resync disk options as upstream for a discard-capable
FILE_THIN volume. Two render-shape divergences remain and are accepted:
upstream additionally emits `block-size 512;` (BS omits it), and upstream
renders the disk block at volume scope vs BS's resource scope —
functionally identical for single-volume resources.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
* fix(satellite): gate rs-discard-granularity to block-device thin pools (FILE_THIN loop wedge)
Rendering rs-discard-granularity into a loop-backed FILE_THIN volume's
disk{} block regressed fresh-create convergence. When the elected day0
winner force-primaries to run mkfs (the FileSystem/Type path), mkfs
issues a full-device discard; on the loop backing that discard storm,
with rs-discard-granularity active, dirties the bitmap relative to the
day0-seeded peers and forces a FULL initial SyncTarget that wedges
(PausedSyncT dependency between the two targets). Proven on stand + CI:
an identical 3-replica create + mkfs converges instantly on LVM_THIN
(real block device, same disk block) but full-resyncs and wedges on
FILE_THIN (loop) — the e2e respawn-standalone-wedge failure.
Gate rs-discard-granularity on the discard-zero-safe block-device
provider set (LVM_THIN / ZFS / ZFS_THIN), the same set as
discard-zeroes-if-aligned. FILE_THIN now renders only the inert
discard-zeroes-if-aligned no (matching pre-feature behaviour) and omits
the granularity. The thin-aware-resync win is retained where it is both
safe and effective: real block-device thin/ZFS pools.
L1 pins (discardgran_test.go): FILE_THIN + thick LVM omit the
granularity; LVM_THIN/ZFS keep it; end-to-end render pins
TestBuildResFile_FileThinDay0SkipRender (no rs-discard-granularity) and
TestBuildResFile_LvmThinDay0SkipRender (keeps it). L6/L7 repurposed to
guard the FILE_THIN fresh-create + mkfs day0-skip convergence and assert
rs-discard-granularity is absent. Known-delta #76 updated.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
* docs(satellite): correct autoDiskOptionsForResource godoc for FILE_THIN gate
Comment-only: the rs-discard-granularity gate is no longer INDEPENDENT
of provider kind — it follows the discard-zero-safe block-device set and
excludes loop-backed FILE_THIN. Align the godoc with the implementation.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
---------
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent a939c9b commit 6291a2d
5 files changed
Lines changed: 550 additions & 88 deletions
File tree
- docs
- pkg/satellite
- tests
- e2e/cli-matrix
- operator-harness/replay
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
141 | 151 | | |
142 | 152 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
151 | 166 | | |
152 | 167 | | |
153 | 168 | | |
| |||
172 | 187 | | |
173 | 188 | | |
174 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
175 | 203 | | |
176 | | - | |
177 | | - | |
| 204 | + | |
178 | 205 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
188 | 215 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
197 | 224 | | |
198 | | - | |
199 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
200 | 231 | | |
201 | 232 | | |
202 | 233 | | |
203 | 234 | | |
204 | 235 | | |
205 | 236 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
212 | 240 | | |
213 | 241 | | |
214 | 242 | | |
215 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
216 | 279 | | |
217 | 280 | | |
218 | 281 | | |
219 | 282 | | |
220 | | - | |
221 | | - | |
222 | | - | |
| 283 | + | |
223 | 284 | | |
224 | 285 | | |
225 | 286 | | |
| |||
0 commit comments