...
- Failover: The new subtask will take over the previously managed sub-directory and delete the un-referenced files in best effort.
- Checkpoint notification message lost: There is a possibility that the notification message from JM to TM may be lost due to some reason. To address this, TM uses a watermark to keep track of the latest checkpoint that utilizes a file or segment, and releases the file or segment when a later checkpoint is subsumed. This ensures that even if notification is lost, the arrival of later messages will still trigger the file cleaning procedure.
- Job stops before the first checkpoint finishes: If the TM have not reported the DirectoryStateHandle of the sub-directory, the TM will delete the sub-directory on exit. Otherwise, the JM will take care of the sub-directory.
4.9. State ownership comparison with other designs
The FLINK-23342 and its design doc[1] provide several designs of state ownership to overcome the disadvantages of having the state files managed by JM. The state ownership design of this FLIP is pretty much like the option 3 in that doc. The main difference is that this FLIP implies the concept of 'epoch' of that doc in the folder path for each granularity (as described in 4.3). Comparing the JM-TM mixed ownership designs of the FLINK-23342 with this FLIP:
Current Flink | Option 5 from the doc: Split counters | Option 3 from the doc: Epochs | Design of this FLIP | |
Ownership | JM | Mixed | Mixed | Mixed |
Granularity of tracking shared state | File | File | Folder | Folder |
Fragility | Bad | Good | Good | Good |
Reupload | On abort | - | On epoch change | On job restart by user |
Cleanup efficiency | Bad | Medium (files but distributed) | Good (folder at once) | Good (folder at once) |
Cleanup reliability | Bad | Bad | Good | Good |
RPC overhead | Bad | Good | Good | Good |
Dev. time | - | Medium / Bad | Medium | Medium |
Invasive change of shared state registry | - | Bad | Good | Very Good |
5. Public interfaces and User Cases
...