From 0a64bf4c94dfec8baad91ac4289779b59048bcaf Mon Sep 17 00:00:00 2001 From: Sourav Maji Date: Tue, 21 May 2024 16:00:24 -0700 Subject: [PATCH] [controller] CI build fix (#997) --- .../linkedin/venice/controller/VeniceParentHelixAdmin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java b/services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java index 408f858a48..4cd3f3f34b 100644 --- a/services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java +++ b/services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java @@ -1157,7 +1157,8 @@ Optional getTopicForCurrentPushJob( final String latestTopicName = latestTopic.get().getName(); int versionNumber = Version.parseVersionFromKafkaTopicName(latestTopicName); Store store = getStore(clusterName, storeName); - if (store.getVersion(versionNumber).map(Version::isVersionSwapDeferred).orElse(false)) { + Version version = store.getVersion(versionNumber); + if (version != null && version.isVersionSwapDeferred()) { LOGGER.error( "There is already future version {} exists for store {}, please wait till the future version is made current.", versionNumber, @@ -3545,7 +3546,8 @@ private OfflinePushStatusInfo getOffLineJobStatus( try (AutoCloseableLock ignore = resources.getClusterLockManager().createStoreWriteLock(storeName)) { ReadWriteStoreRepository repository = resources.getStoreMetadataRepository(); Store parentStore = repository.getStore(storeName); - boolean isDeferredSwap = parentStore.getVersion(versionNum).map(Version::isVersionSwapDeferred).orElse(false); + Version version = parentStore.getVersion(versionNum); + boolean isDeferredSwap = version != null && version.isVersionSwapDeferred(); if (!isDeferredSwap) { // targetedRegions is non-empty for target region push of batch store boolean isTargetRegionPush = !StringUtils.isEmpty(targetedRegions);