Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.92.0
-
None
-
Reviewed
Description
Region server will keep extending the lease on the rowlock as long as there is some action on the row. This is done inside HRegionServer.getLockFromId, where it renew the lease on the rowlock. However, when coprocessor "pre-action" observer is used, getLockFromId is skipped if default action is bypassed. Take HRegionServer.exists as example, RegionCoprocessorHost.preExists could return Boolean object if one of the regionobservers indicates default action should be bypassed; thus getLockFromId didn't called and the lease on the lock doesn't get renewed.
public boolean exists(byte[] regionName, Get get) throws IOException {
checkOpen();
requestCount.incrementAndGet();
try {
HRegion region = getRegion(regionName);
if (region.getCoprocessorHost() != null) {
Boolean result = region.getCoprocessorHost().preExists(get);
if (result != null)
}
Result r = region.get(get, getLockFromId(get.getLockId()));
boolean result = r != null && !r.isEmpty();
if (region.getCoprocessorHost() != null)
return result;
} catch (Throwable t)
}
The application scenario is:
a) client application passes in a rowlock object in an action.
b) there is custom coprocessor/observer used.
c) For a given action, the custom coprocessor/observer might tell coprocessor framework to bypass the default action.
From client application point of view, the behavior is sometimes the rowlock will timeout even though client is accessing the row all the time, depending on whether coprocessor/observer wants to bypass the default action.
This applies to several other actions as well, increment, checkAndPut, checkandDelete.