Commit d142bd1
authored
fix: Compare timestamps for partitions metadata (#3603)
* fix: compare timestamps for partitions metadata last_updated_at
`InspectTable._update_partitions_map_from_manifest_entry` aggregates
per-partition stats over manifest entries, which are iterated in manifest
order rather than chronologically. The guard that keeps the most recently
committed snapshot per partition compared the stored `last_updated_snapshot_id`
(a snapshot id) against `snapshot.timestamp_ms` (a commit timestamp). Snapshot
ids are large positive 63-bit integers, so `id < timestamp_ms` is effectively
always false and the row keeps whichever entry was visited first instead of the
newest one, reporting the wrong `last_updated_at` / `last_updated_snapshot_id`
for any partition touched by more than one snapshot.
Compare the stored `last_updated_at` timestamp against the incoming
`snapshot.timestamp_ms`, matching the Java `PartitionsTable.Partition.update`
which uses `snapshotCommitTime > this.lastUpdatedAt`.
* test: reuse data file in partitions regression test
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
---------
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>1 parent d63d486 commit d142bd1
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments