ruanwenjun commented on PR #12050: URL: https://github.com/apache/dolphinscheduler/pull/12050#issuecomment-1257355617
> > > > When we delete a workerGroup, the TaskInstance should dispatch failed, I think this is our expected. Can we only clear the `workerGroupNodes` map? > > > > > > > > > @ruanwenjun but if we just clear the `workerGroupNodes`, it will affect other normal taskInstance. and i think it will better that keep the memory same as the db and registry center. WDYT > > > > > > Yes, we are talking about how to make the data in memory is the same with db and registry, currently remove the worker which is deleted, just replace the worker group exist. I think we can replace the workerGroup data in memory when sync. > > `WorkerGroup` in the current memory is composed of two parts of data, one of which is synchronized from the database every 10 seconds(just add but never delete), and the other is obtained from the registry center( also just add and never delete). But we cannot make sure this WorkerGroup from DB or Registry center, so cannot make sure which record has been deleted from db or registry center, unless only `Default` keep on registry center. Then my PR just **replace all worker group from DB when sync, and remove this worker group when this record was delete from registry center**, then combing these two part and refresh `workerGroupNodes`. We don't need to care about the workgroup in registry center, we only need to make sure the workgroup in memory is same with db, the worker group in registry center will not display in ui, and it is not correcttly, in same case will cause new problems, e.g. we only config the workerGroupA:10.10.10.10 in ui, but we register 11.11.11.11 as workerGroupA in registry, so the task belongs to workerGroupA can be dispatched 11.11.11.11, this is not our expected. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
