Skip to content

Commit c36e75f

Browse files
committed
fix update lsId if location exists
1 parent 8ef2267 commit c36e75f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,15 @@ private static ObPartitionEntry getPartitionLocationFromResultSetByTablet(TableE
12571257
location = partitionLocationInfo.getPartitionLocation();
12581258
if (location == null) {
12591259
location = new ObPartitionLocation();
1260-
partitionLocationInfo.updateLocation(location, lsId);
12611260
}
1261+
partitionLocationInfo.updateLocation(location, lsId);
1262+
} finally {
1263+
partitionLocationInfo.rwLock.writeLock().unlock();
1264+
}
1265+
} else {
1266+
partitionLocationInfo.rwLock.writeLock().lock();
1267+
try {
1268+
partitionLocationInfo.updateLocation(location, lsId);
12621269
} finally {
12631270
partitionLocationInfo.rwLock.writeLock().unlock();
12641271
}

0 commit comments

Comments
 (0)