/*
* We're reconstructing an unfinished transaction. We know that there
* was a write lock on this LN since it exists in the log under this
* txnId.
*/
final LockResult result = txn.nonBlockingLock
(logLsn, LockType.WRITE, false /*jumpAheadOfWaiters*/, db);
if (result.getLockGrant() == LockGrantType.DENIED) {
throw EnvironmentFailureException.unexpectedState
("Resurrected lock denied txn=" + txn.getId() +
" logLsn=" + DbLsn.getNoFormatString(logLsn) +
" abortLsn=" + DbLsn.getNoFormatString(abortLsn));
}
/*
* Set abortLsn and database for utilization tracking. We don't know
* lastLoggedSize, so a default will be used for utilization counting.
* This should not be common.
*/
result.setAbortLsn(abortLsn, abortKnownDeleted);
final WriteLockInfo wli = result.getWriteLockInfo();
if (wli == null) {
throw EnvironmentFailureException.unexpectedState
("Resurrected lock has no write info txn=" + txn.getId() +
" logLsn=" + DbLsn.getNoFormatString(logLsn) +
" abortLsn=" + DbLsn.getNoFormatString(abortLsn));