Skip to content

Commit

Permalink
[ISSUE #6386] Stop v1 distro verification when cluster upgraded to v2. (
Browse files Browse the repository at this point in the history
  • Loading branch information
pixystone authored Jul 19, 2021
1 parent 29e799f commit 22393e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public String processType() {

@Override
public boolean processVerifyData(DistroData distroData, String sourceAddress) {
// If upgrade to 2.0.X, do not verify for v1.
if (ApplicationUtils.getBean(UpgradeJudgement.class).isUseGrpcFeatures()) {
return true;
}
DistroHttpData distroHttpData = (DistroHttpData) distroData;
Map<String, String> verifyData = (Map<String, String>) distroHttpData.getDeserializedContent();
onReceiveChecksums(verifyData, sourceAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.alibaba.nacos.naming.consistency.ephemeral.distro.DataStore;
import com.alibaba.nacos.naming.consistency.ephemeral.distro.combined.DistroHttpCombinedKey;
import com.alibaba.nacos.naming.core.DistroMapper;
import com.alibaba.nacos.naming.core.v2.upgrade.UpgradeJudgement;
import com.alibaba.nacos.sys.utils.ApplicationUtils;

import java.util.Collections;
Expand Down Expand Up @@ -84,6 +85,10 @@ public DistroData getDatumSnapshot() {

@Override
public List<DistroData> getVerifyData() {
// If upgrade to 2.0.X, do not verify for v1.
if (ApplicationUtils.getBean(UpgradeJudgement.class).isUseGrpcFeatures()) {
return Collections.emptyList();
}
Map<String, String> keyChecksums = new HashMap<>(64);
for (String key : dataStore.keys()) {
if (!distroMapper.responsible(KeyBuilder.getServiceName(key))) {
Expand Down

0 comments on commit 22393e4

Please sign in to comment.