accumulo
accumulo copied to clipboard
Validate lock type in distributed lock recovery code
Describe the bug
For FATE table and namespace locks, Utils.getLock() is called which calls DistributedReadWriteLock.recoverLock. In Utils.getLock() it knows if wants a read or write lock, however when it calls DistributedReadWriteLock.recoverLock() it may return a different lock type. Validation should be added that the recovered lock is of the expected type and throw an exception if it is not.
Expected behavior When the recovered lock does not match the desired type an exception is thrown with information about the lock types and lock ids.
I will look at this.