Skip to content

Commit 66ad49d

Browse files
committed
fix
1 parent 292eaaa commit 66ad49d

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,9 @@ private <T> T executeMutation(String tableName, MutationExecuteCallback<T> callb
792792
if (tryTimes > 1) {
793793
TableEntry entry = getOrRefreshTableEntry(tableName, false, false, false);
794794
Long partId = getPartition(entry, callback.getRowKey());
795-
refreshTableLocationByTabletId(entry, tableName, getTabletIdByPartId(entry, partId));
795+
if (ObGlobal.obVsnMajor() >= 4) {
796+
refreshTableLocationByTabletId(entry, tableName, getTabletIdByPartId(entry, partId));
797+
}
796798
}
797799
// using row key
798800
obPair = getTable(tableName, callback.getRowKey(), needRefreshTableEntry, tableEntryRefreshIntervalWait, false, route);
@@ -1661,7 +1663,7 @@ private ObPair<Long, ObTableParam> getTable(String tableName, Object[] rowKey,
16611663
}
16621664

16631665
long partId = getPartition(tableEntry, row); // partition id in 3.x, origin partId in 4.x, logicId
1664-
if (refresh) {
1666+
if (refresh && ObGlobal.obVsnMajor() >= 4) {
16651667
refreshTableLocationByTabletId(tableEntry, tableName, getTabletIdByPartId(tableEntry, partId));
16661668
}
16671669
return getTableInternal(tableName, tableEntry, partId, waitForRefresh, route);

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientBatchOpsImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.alipay.oceanbase.rpc.table;
1919

20+
import com.alipay.oceanbase.rpc.ObGlobal;
2021
import com.alipay.oceanbase.rpc.ObTableClient;
2122
import com.alipay.oceanbase.rpc.exception.*;
2223
import com.alipay.oceanbase.rpc.location.model.ObServerRoute;
@@ -355,7 +356,9 @@ public void partitionExecute(ObTableOperationResult[] results,
355356
}
356357
TableEntry entry = obTableClient.getOrRefreshTableEntry(tableName, false,
357358
false, false);
358-
obTableClient.refreshTableLocationByTabletId(entry, tableName, partId);
359+
if (ObGlobal.obVsnMajor() >= 4) {
360+
obTableClient.refreshTableLocationByTabletId(entry, tableName, partId);
361+
}
359362
ObTableParam newParam = obTableClient.getTableWithPartId(tableName, partId,
360363
false, obTableClient.isTableEntryRefreshIntervalWait(),
361364
needFetchAllRouteInfo, route).getRight();

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientLSBatchOpsImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.alipay.oceanbase.rpc.table;
1919

20+
import com.alipay.oceanbase.rpc.ObGlobal;
2021
import com.alipay.oceanbase.rpc.ObTableClient;
2122
import com.alipay.oceanbase.rpc.checkandmutate.CheckAndInsUp;
2223
import com.alipay.oceanbase.rpc.exception.*;
@@ -476,7 +477,9 @@ public void partitionExecute(ObTableSingleOpResult[] results,
476477
}
477478
TableEntry entry = obTableClient.getOrRefreshTableEntry(tableName, false,
478479
false, false);
479-
obTableClient.refreshTableLocationByTabletId(entry, tableName, obTableClient.getTabletIdByPartId(entry, originPartId));
480+
if (ObGlobal.obVsnMajor() >= 4) {
481+
obTableClient.refreshTableLocationByTabletId(entry, tableName, obTableClient.getTabletIdByPartId(entry, originPartId));
482+
}
480483
subObTable = obTableClient.getTableWithPartId(tableName, originPartId, needRefreshTableEntry,
481484
obTableClient.isTableEntryRefreshIntervalWait(), false, route).
482485
getRight().getObTable();

0 commit comments

Comments
 (0)