Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG , when role change but not register again #3381

Closed
Cczzzz opened this issue Sep 26, 2021 · 3 comments
Closed

BUG , when role change but not register again #3381

Cczzzz opened this issue Sep 26, 2021 · 3 comments

Comments

@Cczzzz
Copy link
Contributor

Cczzzz commented Sep 26, 2021

I run rocket with

#版本号的方式注册
forceRegister=false
#预先设定好的leader
preferredLeaderId=n0

if i kill the leader, n0 will become again leader.

but n0's brokerId = 1,not 0.
Because role change will not register again

image

BrokerOuterAPI # 281 ,only compare topicConfigWrapper.getDataVersion.

switch (response.getCode()) {
case ResponseCode.SUCCESS: {
QueryDataVersionResponseHeader queryDataVersionResponseHeader =
(QueryDataVersionResponseHeader) response.decodeCommandCustomHeader(QueryDataVersionResponseHeader.class);
changed = queryDataVersionResponseHeader.getChanged();
byte[] body = response.getBody();
if (body != null) {
nameServerDataVersion = DataVersion.decode(body, DataVersion.class);
if (!topicConfigWrapper.getDataVersion().equals(nameServerDataVersion)) {
changed = true;
}
}
if (changed == null || changed) {
changedList.add(Boolean.TRUE);
}
}
default:
break;
}

@RongtongJin
Copy link
Contributor

Good catch, I think forceRegister should be forced to true in here. Could you submit a pull request to fix it?

@Cczzzz
Copy link
Contributor Author

Cczzzz commented Sep 29, 2021

Maybe the version number should be increased when role change

@RongtongJin
Copy link
Contributor

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants