When deploying a PD single node, there is a probability that onLeaderStart cannot be called.
ye-xiaowei opened this issue · 2 comments
ye-xiaowei commented
Describe the bug
Because the store was initialized first, followed by the call to addLeaderStateListerer. Perhaps onLeaderStart has already been called.
Can I adjust the code order in PlacementDriverServer # init?
this.rheaKVStore = new DefaultRheaKVStore();
this.placementDriverService = new DefaultPlacementDriverService(this.rheaKVStore);
this.rheaKVStore.addLeaderStateListener(-1, ((DefaultPlacementDriverService) this.placementDriverService));
if (!this.rheaKVStore.init(rheaOpts)) {
LOG.error("Fail to init [RheaKVStore].");
return false;
}
killme2008 commented
Looks good, can you create a PR to fix it?
ye-xiaowei commented
Looks good, can you create a PR to fix it?
Sure