Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
}
tableParam = getTableParamWithRoute(tableName, rowKey, route);
}
logger.warn("[latency monitor] tableParm obTable ip:port is {}:{}", tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
Comment thread
WeiXinChan marked this conversation as resolved.
Outdated
logger.debug("tableName: {}, tableParam obTable ip:port is {}:{}",
tableName, tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
T t = callback.execute(tableParam);
resetExecuteContinuousFailureCount(tableName);
return t;
Expand Down Expand Up @@ -570,6 +571,8 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
logger.warn(logMessage, ex);
if (ex instanceof ObTableTransportException &&
((ObTableTransportException) ex).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
logger.debug("client execute meet transport timeout, obTable ip:port is {}:{}",
tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
syncRefreshMetadata(true);
TableEntry entry = tableRoute.getTableEntry(tableName);
long partId = tableRoute.getPartId(entry, rowKey);
Expand Down Expand Up @@ -700,7 +703,8 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
throw new ObTableException("RowKey or scan range is null");
}
}
logger.warn("[latency monitor] tableParm obTable ip:port is {}:{}", tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
logger.debug("tableName: {}, tableParam obTable ip:port is {}:{}",
tableName, tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
T t = callback.execute(tableParam);
resetExecuteContinuousFailureCount(tableName);
return t;
Expand Down Expand Up @@ -790,6 +794,8 @@ private <T> T execute(String tableName, OperationExecuteCallback<T> callback,
logger.warn(logMessage, ex);
if (ex instanceof ObTableTransportException &&
((ObTableTransportException) ex).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
logger.debug("client execute meet transport timeout, obTable ip:port is {}:{}",
tableParam.getObTable().getIp(), tableParam.getObTable().getPort());
syncRefreshMetadata(true);
TableEntry entry = tableRoute.getTableEntry(tableName);
long partId = tableRoute.getPartId(entry, callback.getRowKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public void checkStatus() throws Exception {
reconnect("Check connection is null");
}
if (connection.getChannel() == null || !connection.getChannel().isActive()) {
LOGGER.warn("[latency monitor] need to reconnect server: {}:{}", obTable.getIp(), obTable.getPort());
reconnect("Check connection failed for address: " + connection.getUrl());
}
if (!connection.getChannel().isWritable()) {
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/com/alipay/oceanbase/rpc/location/LocationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,7 @@ private static TableEntry callTableEntryRefresh(ObServerAddr obServerAddr, Table
Connection connection = null;
TableEntry entry;
try {
long start = System.currentTimeMillis();
connection = getMetaRefreshConnection(url, sysUA);
logger.warn("[latency monitor] time to build JDBC connection: {}",
System.currentTimeMillis() - start);
entry = callback.execute(connection);
} catch (ObTableNotExistException e) {
// avoid to refresh meta for ObTableNotExistException
Expand Down Expand Up @@ -735,7 +732,6 @@ private static TableEntry getTableEntryFromRemote(final Connection connection,
int tenantId = -1;
int retryTimes = 0;
long sleepTime = 100L;
long start = System.currentTimeMillis();
try {
while (true) {
try {
Expand Down Expand Up @@ -854,8 +850,6 @@ private static TableEntry getTableEntryFromRemote(final Connection connection,
}
} // end while
} finally {
logger.warn("[latency monitor] finish get table entry from remote, execute time: {}",
System.currentTimeMillis() - start);
try {
if (null != rs) {
rs.close();
Expand Down Expand Up @@ -1006,7 +1000,6 @@ public static TableEntry getTableEntryLocationInBatchFromRemote(final Connection
ObTableEntryRefreshException,
ObTableSchemaVersionMismatchException {
try {
long start = System.currentTimeMillis();
int tenantId = checkTenantExistFromRemote(connection, key);
Long[] tablets = null;
if (tableEntry.isPartitionTable()) {
Expand All @@ -1018,12 +1011,10 @@ public static TableEntry getTableEntryLocationInBatchFromRemote(final Connection
// only if the server has no distribution capacity and this table is partitioned table,
// the process of fetching lsId need to be separated with the process of fetch tablets location
// because __all_virtual_tablet_to_ls makes severe impact on performance
logger.warn("[latency monitor] refresh batch location, withLsId, {}", withLsId);
logger.debug("refresh batch location, withLsId, {}", withLsId);
if (withLsId) {
getTabletLsId(connection, tableEntry, tablets, tenantId);
}
logger.warn("[latency monitor] finish get tablet locations in batch, execute time: {}",
System.currentTimeMillis() - start);
} catch (SQLException e) {
// cannot execute sql, maybe some of the observers have been killed
RUNTIME.error(LCD.convert("01-00010"), key, tableEntry, e.getMessage());
Expand Down Expand Up @@ -1456,7 +1447,7 @@ private static TableEntry getTableEntryFromResultSet(TableEntryKey key, ResultSe
}
TableLocation tableLocation = new TableLocation();
tableLocation.setReplicaLocations(replicaLocations);
logger.info("refresh meta get new schema_version: {}", schemaVersion);
logger.debug("refresh meta get new schema_version: {}", schemaVersion);
if (!replicaLocations.isEmpty()) {
entry.setTableId(tableId);
entry.setTableLocation(tableLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public RouteTableRefresher(ObTableClient tableClient) {
* */
private void doRsListCheck() {
try {
logger.info("[latency monitor] background refresher start");
TableRoute tableRoute = tableClient.getTableRoute();
ConfigServerInfo configServer = tableRoute.getConfigServerInfo();
List<ObServerAddr> oldRsList = configServer.getRsList();
Expand All @@ -53,7 +52,6 @@ private void doRsListCheck() {
tableClient.getRsListAcquireConnectTimeout(),
tableClient.getRsListAcquireReadTimeout(), tableClient.getRsListAcquireTryTimes(),
tableClient.getRsListAcquireRetryInterval());
logger.info("[latency monitor] finish loadRsListForConfigServerInfo");
List<ObServerAddr> newRsList = newConfigServer.getRsList();
boolean needRefresh = false;
if (oldRsList.size() != newRsList.size()) {
Expand All @@ -73,7 +71,6 @@ private void doRsListCheck() {
}
}
}
logger.info("[latency monitor] finish needRefresh checking, needRefresh: {}", needRefresh);
if (needRefresh) {
newConfigServer = LocationUtil.refreshIDC2RegionMapFroConfigServerInfo(
newConfigServer, tableClient.getParamURL(),
Expand All @@ -84,7 +81,6 @@ private void doRsListCheck() {
tableRoute.setConfigServerInfo(newConfigServer);
tableRoute.refreshRosterByRsList(newRsList);
}
logger.info("[latency monitor] finish doRsListCheck");
} catch (Exception e) {
logger.warn("RouteTableRefresher::doRsListCheck fail", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
return tableEntry;
}
}
long start = System.currentTimeMillis();
Lock lock = getMetaRefreshLock(tableName);
boolean acquired = false;
try {
Expand All @@ -137,18 +136,16 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
}
tryTimes++;
try {
logger.warn("[latency monitor] try to acquire refresh table meta lock, tableName: {}", tableName);
if (!acquired) {
acquired = lock.tryLock(tableEntryRefreshLockTimeout, TimeUnit.MILLISECONDS);
}
if (!acquired) {
String errMsg = "try to lock tableEntry refreshing timeout, tableName:" + tableName
+ " , timeout:" + tableEntryRefreshLockTimeout + ".";
RUNTIME.warn(errMsg);
logger.warn("[latency monitor] fail to acquire refresh table meta lock, tableName: {}", tableName);
throw new ObTableTryLockTimeoutException(errMsg);
}
logger.warn("[latency monitor] success to acquire refresh table meta lock, tableName: {}", tableName);
logger.debug("success to acquire refresh table meta lock, tableName: {}", tableName);
tableEntry = locations.get(tableName);
if (tableEntry != null) {
long current = System.currentTimeMillis();
Expand Down Expand Up @@ -192,7 +189,6 @@ public TableEntry refreshMeta(String tableName, ServerRoster serverRoster,
}
} // end while
} finally {
logger.warn("[latency monitor] unlock refresh table meta lock, tableName: {}, execute time: {}", tableName, System.currentTimeMillis() - start);
if (acquired) {
lock.unlock();
}
Expand All @@ -214,7 +210,6 @@ private TableEntry refreshTableEntry(TableEntry tableEntry, String tableName,
TableEntryKey tableEntryKey = new TableEntryKey(tableClient.getClusterName(),
tableClient.getTenantName(), tableClient.getDatabase(), tableName);
try {
long start = System.currentTimeMillis();
// tableEntry will point to a new object, the old tableEntry will be gc by jvm
tableEntry = loadTableEntryWithPriority(serverRoster, //
tableEntry, //
Expand All @@ -223,7 +218,6 @@ private TableEntry refreshTableEntry(TableEntry tableEntry, String tableName,
tableClient.getTableEntryAcquireSocketTimeout(),//
tableClient.getServerAddressPriorityTimeout(), sysUA, !tableClient
.getServerCapacity().isSupportDistributedExecute());
logger.warn("[latency monitor] finish loadTableEntryWithPriority in refresh meta, execute time: {}", System.currentTimeMillis() - start);
if (tableEntry.isPartitionTable()) {
switch (tableClient.getRunningMode()) {
case HBASE:
Expand Down Expand Up @@ -306,8 +300,6 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
}
Lock lock = locationInfo.refreshLock;
boolean acquired = false;
logger.warn("[latency monitor] try to acquire refresh table location lock, tableName: {}", tableName);
long start = System.currentTimeMillis();
try {
int tryTimes = 0;
long startExecute = System.currentTimeMillis();
Expand All @@ -334,7 +326,7 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
RUNTIME.warn(errMsg);
throw new ObTableTryLockTimeoutException(errMsg);
}
logger.warn("[latency monitor] success acquire refresh table location lock, tableName: {}", tableName);
logger.debug("success acquire refresh table location lock, tableName: {}", tableName);
locationInfo = tableEntry.getPartitionEntry().getPartitionInfo(tabletId);
lastRefreshTime = locationInfo.getLastUpdateTime();
currentTime = System.currentTimeMillis();
Expand All @@ -345,7 +337,6 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
tableName, lastRefreshTime, tableEntryRefreshInterval, currentTime);
return tableEntry;
}
logger.warn("[latency monitor] do refresh table location lock, tableName: {}", tableName);
tableEntry = loadTableEntryLocationWithPriority(serverRoster, tableEntryKey,
tableEntry, tabletId, tableClient.getTableEntryAcquireConnectTimeout(),
tableClient.getTableEntryAcquireSocketTimeout(),
Expand All @@ -363,12 +354,12 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
RUNTIME.error(
"refresh partition location meet schema_version mismatched exception, tryTimes: {}", tryTimes, e);
long schemaVersion = tableEntry.getSchemaVersion();
logger.warn("[latency monitor] old schema_version is: {}", schemaVersion);
logger.debug(
"schema_version mismatch when refreshing tablet location, old schema_version is: {}", schemaVersion);
tableEntry = locations.get(tableName);
// sleep over waiting interval of refreshing meta to refresh meta
long interval = System.currentTimeMillis()
- tableEntry.getRefreshMetaTimeMills();
logger.warn("[latency monitor] interval is: {}", interval);
if (interval < 100) {
Thread.sleep(100 - interval);
}
Expand Down Expand Up @@ -402,10 +393,6 @@ public TableEntry refreshPartitionLocation(TableEntry tableEntry, String tableNa
tableEntryRefreshContinuousFailureCount.set(0);
return tableEntry;
} finally {
logger
.warn(
"[latency monitor] finish refresh table location lock, tableName: {}, execute time: {}",
tableName, System.currentTimeMillis() - start);
if (acquired) {
lock.unlock();
}
Expand Down Expand Up @@ -445,8 +432,6 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
}
Lock lock = getLocationBatchRefreshLock(tableName);
boolean acquired = false;
logger.warn("[latency monitor] try to acquire refresh tablet locations in batch lock, tableName: {}", tableName);
long start = System.currentTimeMillis();
try {
int tryTimes = 0;
long startExecute = System.currentTimeMillis();
Expand All @@ -468,13 +453,12 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
acquired = lock.tryLock(tableEntryRefreshLockTimeout, TimeUnit.MILLISECONDS);
}
if (!acquired) {
logger.warn("[latency monitor] fail to acquire refresh tablet locations in batch lock, tableName: {}", tableName);
String errMsg = "try to lock locations refreshing in batch timeout " + " ,tableName:"
+ tableName + " , timeout:" + tableEntryRefreshLockTimeout + ".";
RUNTIME.warn(errMsg);
throw new ObTableTryLockTimeoutException(errMsg);
}
logger.warn("[latency monitor] success to acquire refresh tablet locations in batch lock, tableName: {}", tableName);
logger.debug("success to acquire refresh tablet locations in batch lock, tableName: {}", tableName);
lastRefreshTime = tableEntry.getPartitionEntry().getLastRefreshAllTime();
currentTime = System.currentTimeMillis();
if (currentTime - lastRefreshTime < refreshBatchTabletInterval) {
Expand All @@ -484,7 +468,6 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
tableName, lastRefreshTime, refreshBatchTabletInterval, currentTime);
return tableEntry;
}
logger.warn("[latency monitor] do refresh tablet locations in batch lock, tableName: {}", tableName);
tableEntry = loadTableEntryLocationInBatchWithPriority(serverRoster,
tableEntryKey, tableEntry,
tableClient.getTableEntryAcquireConnectTimeout(),
Expand All @@ -503,11 +486,11 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
RUNTIME.error(
"refresh location in batch meet schema_version mismatched exception, tryTimes: {}", tryTimes, e);
long schemaVersion = tableEntry.getSchemaVersion();
logger.warn("[latency monitor] old schema_version is: {}", schemaVersion);
logger.debug(
"schema_version mismatch when refreshing tablet locations in batch, old schema_version is: {}", schemaVersion);
tableEntry = locations.get(tableName);
// sleep over waiting interval of refreshing meta to refresh meta
long interval = System.currentTimeMillis() - tableEntry.getRefreshMetaTimeMills();
logger.warn("[latency monitor] interval is: {}", interval);
if (interval < 100) {
Thread.sleep(100 - interval);
}
Expand Down Expand Up @@ -541,7 +524,6 @@ public TableEntry refreshTabletLocationBatch(TableEntry tableEntry, String table
tableEntryRefreshContinuousFailureCount.set(0);
return tableEntry;
} finally {
logger.warn("[latency monitor] unlock refresh tablet locations in batch lock, tableName: {}, execute time: {}", tableName, System.currentTimeMillis() - start);
if (acquired) {
lock.unlock();
}
Expand Down
Loading