Skip to content

Commit cbd1948

Browse files
committed
add ls_id refreshing log; refreshMeta retry uses tableEntryRefreshTryTimes
1 parent 6c7477a commit cbd1948

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/main/java/com/alipay/oceanbase/rpc/location/LocationUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ private static void getTabletLsId(final Connection connection, TableEntry tableE
931931
if (rs.wasNull()) {
932932
continue;
933933
}
934+
logger.warn("[latency monitor] refresh batch location, lsId: {}, tabletId: {}", lsId, tabletId);
934935
tabletLsMap.put(tabletId, lsId);
935936
ObPartitionLocationInfo partitionLocationInfo = partitionEntry
936937
.getPartitionInfo(tabletId);
@@ -1018,6 +1019,7 @@ public static TableEntry getTableEntryLocationInBatchFromRemote(final Connection
10181019
// only if the server has no distribution capacity and this table is partitioned table,
10191020
// the process of fetching lsId need to be separated with the process of fetch tablets location
10201021
// because __all_virtual_tablet_to_ls makes severe impact on performance
1022+
logger.warn("[latency monitor] refresh batch location, withLsId, {}", withLsId);
10211023
if (withLsId) {
10221024
getTabletLsId(connection, tableEntry, tablets, tenantId);
10231025
}

src/main/java/com/alipay/oceanbase/rpc/location/model/TableLocations.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
140140
return tableEntry;
141141
}
142142
}
143-
int serverSize = serverRoster.getMembers().size();
144-
int refreshTryTimes = Math.min(tableEntryRefreshTryTimes, serverSize);
145-
for (int i = 0; i < refreshTryTimes; ++i) {
143+
for (int i = 0; i < tableEntryRefreshTryTimes; ++i) {
146144
try {
147145
return refreshTableEntry(tableEntry, tableName, serverRoster, sysUA);
148146
} catch (ObTableNotExistException e) {
@@ -157,15 +155,11 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
157155
tableClient.syncRefreshMetadata(false);
158156
tableEntryRefreshContinuousFailureCount.set(0);
159157
serverRoster = tableClient.getTableRoute().getServerRoster();
160-
refreshTryTimes = Math.min(tableEntryRefreshTryTimes, serverRoster
161-
.getMembers().size());
162158
} else if (e.isConnectInactive()) {
163159
// getMetaRefreshConnection failed, maybe the server is down, so we need to refresh metadata directly
164160
tableClient.syncRefreshMetadata(true);
165161
tableEntryRefreshContinuousFailureCount.set(0);
166162
serverRoster = tableClient.getTableRoute().getServerRoster();
167-
refreshTryTimes = Math.min(tableEntryRefreshTryTimes, serverRoster
168-
.getMembers().size());
169163
}
170164
} catch (Throwable t) {
171165
RUNTIME.error("refresh table meta meet exception", t);
@@ -175,7 +169,7 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
175169
// maybe the retry time is too small, need to instantly refresh roster
176170
logger.info(
177171
"refresh table entry has tried {}-times failure and will sync refresh metadata",
178-
refreshTryTimes);
172+
tableEntryRefreshTryTimes);
179173
tableClient.syncRefreshMetadata(false);
180174
tableEntryRefreshContinuousFailureCount.set(0);
181175
serverRoster = tableClient.getTableRoute().getServerRoster();

0 commit comments

Comments
 (0)