Skip to content

Commit

Permalink
add log, combine booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
misyel committed Dec 10, 2024
1 parent e3f65d2 commit f84707f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1135,11 +1135,19 @@ private void updateStoreVersionStatus(String storeName, int versionNumber, Versi
* after targetSwapRegionWaitTime passes)
*/
Set<String> targetRegions = RegionUtils.parseRegionsFilterList(version.getTargetSwapRegion());
boolean isValidTargetRegion = targetRegions.contains(regionName);
boolean isTargetRegionPushWithDeferredSwap = version.isVersionSwapDeferred() && isValidTargetRegion;
boolean isTargetRegionPushWithDeferredSwap =
version.isVersionSwapDeferred() && targetRegions.contains(regionName);
boolean isNormalPush = !version.isVersionSwapDeferred();
boolean isDeferredSwap = version.isVersionSwapDeferred() && targetRegions.isEmpty();
if (isTargetRegionPushWithDeferredSwap || isNormalPush) {
LOGGER.debug(
"Swapping to version {} for store {} in region {}. isTargetRegionPushWithDeferredSwap is {} and"
+ "isNormalPush is {}",
versionNumber,
store.getName(),
regionName,
isTargetRegionPushWithDeferredSwap,
isNormalPush);
int previousVersion = store.getCurrentVersion();
store.setCurrentVersion(versionNumber);
realTimeTopicSwitcher.transmitVersionSwapMessage(store, previousVersion, versionNumber);
Expand Down

0 comments on commit f84707f

Please sign in to comment.