Skip to content

Commit 292eaaa

Browse files
committed
fix
1 parent 2bac7bb commit 292eaaa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,9 +1938,14 @@ private List<ObPair<Long, ReplicaLocation>> getPartitionReplica(TableEntry table
19381938
List<ObPair<Long, ReplicaLocation>> replicas = new ArrayList<>();
19391939

19401940
if (!tableEntry.isPartitionTable() || tableEntry.getPartitionInfo().getLevel() == ObPartitionLevel.LEVEL_ZERO) {
1941-
long tabletId = getTabletIdByPartId(tableEntry, 0L);
1942-
ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo(tableEntry, tableName, tabletId);
1943-
replicas.add(new ObPair<>(tabletId, getPartitionLocation(locationInfo, route)));
1941+
if (ObGlobal.obVsnMajor() >= 4) {
1942+
long tabletId = getTabletIdByPartId(tableEntry, 0L);
1943+
ObPartitionLocationInfo locationInfo = getOrRefreshPartitionInfo(tableEntry, tableName, tabletId);
1944+
replicas.add(new ObPair<>(tabletId, getPartitionLocation(locationInfo, route)));
1945+
} else {
1946+
replicas.add(new ObPair<Long, ReplicaLocation>(0L, getPartitionLocation(tableEntry, 0L,
1947+
route)));
1948+
}
19441949
return replicas;
19451950
}
19461951

0 commit comments

Comments
 (0)