Skip to content

Commit ccdad34

Browse files
author
Ritesh Garg
committed
PHOENIX-7566 ZK to SystemTable Sync and Event Reactor for Failover
1 parent 88ff8a9 commit ccdad34

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/HAGroupStoreClient.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,16 @@ public void setHAGroupStatusIfNeeded(HAGroupStoreRecord.HAGroupState haGroupStat
349349
+ " checking if state is already updated in local cache", e);
350350
// Check against current cached record,
351351
// hoping that record is updated in local cache.
352-
Pair<HAGroupStoreRecord, Stat> cachedRecord
352+
Pair<HAGroupStoreRecord, Stat> cachedRecord
353353
= fetchCacheRecordAndPopulateZKIfNeeded(pathChildrenCache, ClusterType.LOCAL);
354354
currentHAGroupStoreRecord = cachedRecord.getLeft();
355355
Stat previousHAGroupStoreRecordStat = currentHAGroupStoreRecordStat;
356356
currentHAGroupStoreRecordStat = cachedRecord.getRight();
357357
if (currentHAGroupStoreRecord != null
358358
&& currentHAGroupStoreRecord.getHAGroupState()
359359
== haGroupState) {
360-
LOGGER.debug("HAGroupStoreRecord for HA group {} is already updated"
361-
+ "with state {}, no need to update",
360+
LOGGER.debug("HAGroupStoreRecord for HA group {} is already updated"
361+
+ "with state {}, no need to update",
362362
haGroupName, haGroupState);
363363
return;
364364
// Check if the cached version is not updated, only then check with ZK.
@@ -372,7 +372,7 @@ public void setHAGroupStatusIfNeeded(HAGroupStoreRecord.HAGroupState haGroupStat
372372
= phoenixHaAdmin.getHAGroupStoreRecordInZooKeeper(haGroupName)
373373
.getLeft();
374374
if (currentHAGroupStoreRecord != null
375-
&& currentHAGroupStoreRecord.getHAGroupState()
375+
&& currentHAGroupStoreRecord.getHAGroupState()
376376
== haGroupState) {
377377
LOGGER.debug("HAGroupStoreRecord for HA group {} is already "
378378
+ "updated with state {}, no need to update",
@@ -457,7 +457,7 @@ private void initializeZNodeIfNeeded() throws IOException, SQLException {
457457
HAGroupStoreRecord haGroupStoreRecord = cacheRecordFromZK.getLeft();
458458
// Only if the ZNode is not present, we need to create it from System Table
459459
if (haGroupStoreRecord == null) {
460-
SystemTableHAGroupRecord systemTableRecord
460+
SystemTableHAGroupRecord systemTableRecord
461461
= getSystemTableHAGroupRecord(this.haGroupName);
462462
Preconditions.checkNotNull(systemTableRecord,
463463
"System Table HAGroupRecord cannot be null");
@@ -696,7 +696,7 @@ private void updateSystemTableHAGroupRecordSilently(String haGroupName,
696696
pstmt.executeUpdate();
697697
conn.commit();
698698
} catch (Exception e) {
699-
LOGGER.error("Failed to update system table on best"
699+
LOGGER.error("Failed to update system table on best"
700700
+ "effort basis for HA group {}, error: {}", haGroupName, e);
701701
}
702702
}
@@ -718,7 +718,7 @@ private void startPeriodicSyncJob() {
718718
DEFAULT_HA_GROUP_STORE_SYNC_INTERVAL_SECONDS);
719719

720720
// Add jitter to initial delay
721-
long jitterSeconds
721+
long jitterSeconds
722722
= ThreadLocalRandom.current().nextLong(0, SYNC_JOB_MAX_JITTER_SECONDS + 1);
723723

724724
LOGGER.info("Starting periodic sync job for HA group {} "

phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/HAGroupStoreManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ HAGroupStoreRecord.HAGroupState determineTarget(
124124
return transitions;
125125
}
126126

127-
private static Map<HAGroupStoreRecord.HAGroupState, TargetStateResolver>
127+
private static Map<HAGroupStoreRecord.HAGroupState, TargetStateResolver>
128128
createLocalStateTransitions() {
129129
Map<HAGroupStoreRecord.HAGroupState, TargetStateResolver> transitions = new HashMap<>();
130130
// Local abort transitions - these are simple transitions (no condition check)

phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
631631
throw new IOException("HAGroupStoreManager is null "
632632
+ "for current cluster, check configuration");
633633
}
634-
String tableName
634+
String tableName
635635
= c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString();
636636
// We don't want to check for mutation blocking for the system ha group table
637637
if (!tableName.equals(SYSTEM_HA_GROUP_NAME)) {

0 commit comments

Comments
 (0)