You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2026/06/05 08:27:12 UTC
Re: [PR] [Feature][Zeta] Decouple Hazelcast IMap via StateStore Abstraction [seatunnel]
zhangshenghang commented on PR #10812:
URL: https://github.com/apache/seatunnel/pull/10812#issuecomment-4629603490
Thanks for the effort on this — the direction is valuable. However, in its current form I have some concerns that I think need to be
addressed before merge. I verified the points below against the full seatunnel-engine-server module.
1. The decoupling is incomplete — most of the new abstraction has zero callers
HazelcastEngineStateStores.ensureInitialized() constructs 12 stores, but only 2 are actually consumed anywhere:
- MetricsSnapshotStateStore (via SeaTunnelServer#updateMetrics/removeMetrics)
- CheckpointOverviewStateStore (via CheckpointMonitorService)
The other ~10 — runningJobInfoStore, runningJobStateStore, runningJobStateTimestampsStore, ownedSlotProfilesStore, finishedJob*Store, checkpointCounterStore, pendingPipelineCleanupStore, connectorJarReferenceStateStore —
have no callers. Meanwhile the real consumers of that state still access raw IMap directly and are untouched by this PR:
- CoordinatorService
- IMapCheckpointIDCounter
- SharedConnectorJarStorageStrategy
- JobMaster
- TaskExecutionContext
- JobInfoService / BaseService / GetOverviewOperation / PhysicalVertex
Net result: the coupling the PR aims to remove is still fully present, and we've added ~2,000 lines of parallel, unreferenced code on top. I'd suggest one of:
- Narrow the scope: keep only the two stores that are actually wired in (metrics + checkpoint overview), drop the rest, and migrate the remaining consumers in follow-up PRs; or
- Complete the migration in this PR by switching the corresponding consumers (CoordinatorService → runtime/cleanup stores, IMapCheckpointIDCounter → counter store, etc.) to the new abstraction.
The current "add the new layer but keep the old one" intermediate state is the hardest to maintain.
2. Map-name constants are duplicated → silent split-brain risk
EngineStateStoreNames re-declares all 12 names with values identical to engine.common.Constant.IMAP_* (e.g. both define "engine_runningJobMetrics", "engine_checkpoint_monitor", …). Because the new stores and the legacy
direct-IMap consumers must always point to the same map, having two sources of truth means a future edit to one set of constants would silently make half the components read/write a different map — surfacing as
"metrics/checkpoint overview mysteriously empty" and very hard to debug.
Please reference Constant.IMAP_* directly instead of copying the literals.
3. Metrics partition logic is duplicated, so the map isn't really encapsulated
HazelcastMetricsSnapshotStateStore#partition() and SeaTunnelServer#getMetricsImapPartition() (still used by TaskExecutionContext) implement the same partitioning. Writes now go through the store, but reads
(TaskExecutionContext#getOrCreateMetricsContext) still bypass it and compute the partition via the static method against the raw IMap. They agree today (0x7FFFFFFF == Integer.MAX_VALUE), but this is exactly the coupling the
abstraction should remove — any change to one side breaks read/write consistency. Consider routing the read through MetricsSnapshotStateStore#get(taskLocation) and keeping the partition logic in one place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org