Commit dfce91f
committed
compute: drop the duplicated instants from the hydration times relation
`installed_at` and `started_at` were maintained twice, in this relation and in
`mz_compute_lifecycle_events_per_worker`, from the same handlers and the same
event times, with the `installed_at <= started_at` invariant enforced in both
representations. Keep them in one place: the lifecycle log's `installed` and
`started` events.
`time_ns` and `hydrated_at` stay. They are not duplicates of anything, because
`hydrated_at` is the durability reading, taken when the reported output frontier
passes the as-of. That frontier is the meet of the write and compute frontiers, so
for a collection that sinks to persist it moves only once the output is durable,
while for an index, which produces its output by writing its own trace, it
coincides with computation. One column meant two things depending on the object.
The lifecycle log answers that by using separate terms rather than redefining the
column: its `hydrated` is always the dataflow-progress reading and its `written`
is always the durability one, neither depending on the object type. Pivoting the
log's `hydrated` into `hydrated_at` would therefore not be a refactor but a
redefinition, and since `mz_compute_hydration_statuses.hydrated` is `time_ns IS
NOT NULL` and feeds the blue-green readiness query, it would have readiness cut
over on the earlier compute reading, before the output is durable. Comments at
both relations record which reading each term carries.
`handle_hydration_start` no longer writes to the hydration-time output, since
nothing it changes is packed there any more; its retract-and-reinsert pair would
have been a no-op. `started_at` survives as internal state only, to guard the
handler and to back-fill `started` in `handle_hydration`.
`test/testdrive/hydration-timestamps.td` moves its stage scenarios to the
lifecycle relation and keeps the duration assertions here, so it now tests that
the two relations agree rather than that one of them is self-consistent. The
`time_ns` cross-check joins them on `(export_id, worker_id)`, both being per
worker.
No new migration step: the index key `(export_id, worker_id)` is unchanged, and
the `mz_indexes` fingerprint move is covered by the existing replacement step at
this dev version.
Part of CPU-226
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ZVCMBSLdxzGus78ZKWhZz1 parent 98e7e26 commit dfce91f
5 files changed
Lines changed: 195 additions & 123 deletions
File tree
- doc/developer/design
- src
- compute-client/src
- compute/src/logging
- test
- sqllogictest
- testdrive
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
239 | 261 | | |
240 | 262 | | |
241 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
356 | 370 | | |
357 | 371 | | |
358 | 372 | | |
359 | 373 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | 738 | | |
743 | 739 | | |
744 | 740 | | |
| |||
861 | 857 | | |
862 | 858 | | |
863 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | | - | |
1188 | | - | |
| 1187 | + | |
1189 | 1188 | | |
1190 | 1189 | | |
1191 | 1190 | | |
| |||
1200 | 1199 | | |
1201 | 1200 | | |
1202 | 1201 | | |
1203 | | - | |
1204 | 1202 | | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | 1203 | | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1219 | 1208 | | |
1220 | 1209 | | |
1221 | 1210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | 361 | | |
364 | 362 | | |
365 | 363 | | |
| |||
0 commit comments