Repository navigation
Commit cf84aba
[fix](ivm) Wait for the TSO service before a keep-alive round
### What problem does this PR solve?
Issue Number: None
Related PR: #69831
Problem Summary:
`startMasterOnlyDaemonThreads()` starts `IvmStreamKeepAliveDaemon` before the TSO service, and both wait for `Env.isReady` before their first cycle. The TSO service calibrates itself in that first cycle, which writes the next allocation window to the edit log and, in cloud mode, advances MetaService's TSO fence, so the first keep-alive check after an FE restart or a master change can come before it. The daemon set `lastRoundMs` before running the round, so such a round was spent for nothing: in shared-nothing mode `getTSO()` threw "TSO timestamp is not calibrated" at the first stream with a partition due for renewal, which ended the round, and in cloud mode the round was skipped because the TSO status was not initialized. The next round then came `ivm_stream_keepalive_interval_second` (600 seconds by default) later. With a `changelog.ttl_seconds` close to twice the interval, which the config description allows, an idle offset could expire before that round: an AUTO refresh fell back to COMPLETE and a strict INCREMENTAL refresh failed. No row was read wrong.
A round now waits until the TSO service is initialized, without setting `lastRoundMs`, so the first check after the TSO service is ready starts it.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `IvmStreamKeepAliveDaemonTest`: no round starts while the TSO service is not initialized, the first check after it is starts one, and the next round waits for the interval.
- Behavior changed: No
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 19b8e52 commit cf84aba
2 files changed
Lines changed: 80 additions & 0 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/mtmv/ivm
- test/java/org/apache/doris/mtmv/ivm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments