Skip to content

Commit b255470

Browse files
authored
recalculate rowkey when retry considering partition splitting (#356)
1 parent df5a639 commit b255470

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ private <T> T execute(String tableName, TableExecuteCallback<T> callback, ObServ
483483
if (tryTimes > 1 && needRefreshPartitionLocation) {
484484
needRefreshPartitionLocation = false;
485485
// refresh partition location
486+
// recalculate rowkey in the situation of partition splitting
487+
rowKey = transformToRow(tableName, callback.getRowKey());
486488
TableEntry entry = tableRoute.getTableEntry(tableName);
487489
long partId = tableRoute.getPartId(entry, rowKey);
488490
long tabletId = tableRoute.getTabletIdByPartId(entry, partId);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,9 +1441,6 @@ private static TableEntry getTableEntryFromResultSet(TableEntryKey key, ResultSe
14411441
Long tableId = null;
14421442
Long schemaVersion = null;
14431443
List<ReplicaLocation> replicaLocations = new ArrayList<ReplicaLocation>(3);
1444-
if (!rs.isBeforeFirst()) {
1445-
logger.error("[table not exist test] cannot find any location for this tenant, tenantName: {}, tableName: {}, databaseName: {}", key.getTenantName(), key.getTableName(), key.getDatabaseName());
1446-
}
14471444
while (rs.next()) {
14481445
ReplicaLocation replica = buildReplicaLocation(rs);
14491446
tableId = rs.getLong("table_id");

0 commit comments

Comments
 (0)