Skip to content

Commit c83fd94

Browse files
committed
CLOUDSTACK-4037: [GSLB] removeFromGSLBRule is not cleaning the
cloudsite1 infro from the second site NetScaler device ensuring when a site no longer participates in GSLB, complete GSLB config for that rule is wiped out on the GSLB provider for that site
1 parent ab9ce67 commit c83fd94

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎core/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigCommand.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public boolean isForRevoke() {
9393
return revoked;
9494
}
9595

96+
public void setForRevoke(boolean revoke) {
97+
this.revoked = revoke;
98+
}
99+
96100
@Override
97101
public boolean executeInSequence() {
98102
return false;

‎server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ private boolean applyGlobalLoadBalancerRuleConfig(long gslbRuleId, boolean revok
661661
for (Pair<Long,Long> zoneId: gslbSiteIds) {
662662

663663
List<SiteLoadBalancerConfig> slbs = new ArrayList<SiteLoadBalancerConfig>();
664-
665664
// set site as 'local' for the site in that zone
666665
for (Pair<Long,Long> innerLoopZoneId: gslbSiteIds) {
667666
SiteLoadBalancerConfig siteLb = zoneSiteLoadbalancerMap.get(innerLoopZoneId.first());
@@ -670,6 +669,14 @@ private boolean applyGlobalLoadBalancerRuleConfig(long gslbRuleId, boolean revok
670669
}
671670

672671
gslbConfigCmd.setSiteLoadBalancers(slbs);
672+
gslbConfigCmd.setForRevoke(revoke);
673+
674+
// revoke GSLB configuration completely on the site GSLB provider for the sites that no longer
675+
// are participants of a GSLB rule
676+
SiteLoadBalancerConfig siteLb = zoneSiteLoadbalancerMap.get(zoneId.first());
677+
if (siteLb.forRevoke()) {
678+
gslbConfigCmd.setForRevoke(true);
679+
}
673680

674681
try {
675682
_gslbProvider.applyGlobalLoadBalancerRule(zoneId.first(), zoneId.second(), gslbConfigCmd);

0 commit comments

Comments
 (0)