kadirozde commented on code in PR #1943:
URL: https://github.com/apache/phoenix/pull/1943#discussion_r1688636796
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -3920,24 +3930,59 @@ private PTable doGetTable(byte[] tenantId, byte[]
schemaName, byte[] tableName,
}
return table;
}
- // Query for the latest table first, since it's not cached
- table =
- buildTable(key, cacheKey, region,
HConstants.LATEST_TIMESTAMP, clientVersion);
- if ((table != null && table.getTimeStamp() <= clientTimeStamp) ||
- (blockWriteRebuildIndex &&
table.getIndexDisableTimestamp() > 0)) {
- return table;
+ if (!wasLocked && rowLock != null) {
Review Comment:
Since we are using two different locking mechanisms, we should not release
the original read lock here. Otherwise, we attempt to get the table from the
cache without a lock essentially and this will race with another thread that
takes a write lock and make a change on the object. We do not want this to
happen.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]