Summary
Completes removal of the pessimistic insertion lock. Under Aspnes & Shah, "Skip Graphs" (arXiv:cs/0306043), Algorithm 2 joins a node lock-free by order-verification forwarding, so no node-level lock is needed. Once the lock-coordination RPCs and the locked-retry transport have been removed, the InsertionLock class, the node's lock methods, and the leftover backoff / locked packet fields are unreferenced scaffolding.
This issue deletes that scaffolding and the dead version guard.
Scope
src/main/java/skipnode/InsertionLock.java — delete the whole file (the Semaphore-based lock, startInsertion / endInsertion, tryAcquire / unlockOwned, isLocked / isLockedBy, the holder / owner fields, and the nested NeighborInstance class).
src/main/java/skipnode/SkipNode.java:
- Remove the
InsertionLock / NeighborInstance import, the insertionLock and ownedLocks fields, the insertionLock.startInsertion() call in the constructor, and the insertionLock.endInsertion() calls in insert().
- Remove the
tryAcquire(SkipNodeIdentity), unlock(SkipNodeIdentity), isLocked(), and isLockedBy(String, int) overrides.
- Remove the dead version guard from the old
tryAcquire path (the version != this.version self-comparison, which compares the field to itself and is always false), and remove the now write-only version field together with its version++ increment in insertIntoTable(...).
- Simplify
isAvailable() to return inserted (drop the insertionLock.isLocked() term).
- Remove any residual lock scaffolding left in the insertion path after the lock-free join rewrite (e.g. an
acquireNeighborLocks(...) method or ownedLocks bookkeeping), if still present.
src/main/java/skipnode/SkipNodeInterface.java — remove the unlock, tryAcquire, isLocked, and isLockedBy method declarations.
src/main/java/underlay/packets/Request.java — remove the now-unused backoff field and its comment.
src/main/java/underlay/packets/Response.java — remove the now-unused locked field and the Response(boolean) constructor, keeping the no-arg constructor.
Acceptance Criteria
Dependencies
- Requires the lock-free join rewrite (Algorithm 2) to have landed, so the insertion path no longer uses these lock methods.
- Requires the prior cleanup that removed the
AcquireLock / ReleaseLock / IsAvailable RPCs and the locked-retry routing gates (which were the consumers of these methods and the last readers of the backoff / locked fields); without it, this change does not compile.
Part of #33. Depends on: #40
Summary
Completes removal of the pessimistic insertion lock. Under Aspnes & Shah, "Skip Graphs" (arXiv:cs/0306043), Algorithm 2 joins a node lock-free by order-verification forwarding, so no node-level lock is needed. Once the lock-coordination RPCs and the locked-retry transport have been removed, the
InsertionLockclass, the node's lock methods, and the leftoverbackoff/lockedpacket fields are unreferenced scaffolding.This issue deletes that scaffolding and the dead version guard.
Scope
src/main/java/skipnode/InsertionLock.java— delete the whole file (theSemaphore-based lock,startInsertion/endInsertion,tryAcquire/unlockOwned,isLocked/isLockedBy, theholder/ownerfields, and the nestedNeighborInstanceclass).src/main/java/skipnode/SkipNode.java:InsertionLock/NeighborInstanceimport, theinsertionLockandownedLocksfields, theinsertionLock.startInsertion()call in the constructor, and theinsertionLock.endInsertion()calls ininsert().tryAcquire(SkipNodeIdentity),unlock(SkipNodeIdentity),isLocked(), andisLockedBy(String, int)overrides.tryAcquirepath (theversion != this.versionself-comparison, which compares the field to itself and is always false), and remove the now write-onlyversionfield together with itsversion++increment ininsertIntoTable(...).isAvailable()to returninserted(drop theinsertionLock.isLocked()term).acquireNeighborLocks(...)method orownedLocksbookkeeping), if still present.src/main/java/skipnode/SkipNodeInterface.java— remove theunlock,tryAcquire,isLocked, andisLockedBymethod declarations.src/main/java/underlay/packets/Request.java— remove the now-unusedbackofffield and its comment.src/main/java/underlay/packets/Response.java— remove the now-unusedlockedfield and theResponse(boolean)constructor, keeping the no-arg constructor.Acceptance Criteria
InsertionLock.javais deleted; no source file imports or referencesInsertionLockorNeighborInstance.SkipNodehas noinsertionLock/ownedLocksfields and notryAcquire/unlock/isLocked/isLockedBymethods;SkipNodeInterfaceno longer declares them.isAvailable()returnsinserted.versionfield, its increment, and the self-comparison guard are gone.Requestno longer has abackofffield andResponseno longer has alockedfield orResponse(boolean)constructor; a repo-wide search finds no references torequest.backofforresponse.locked.InsertionLock,startInsertion,endInsertion,unlockOwned,insertionLock, orisLockedBy.isAvailable() == falsebefore insertion andisAvailable() == trueafter its insertion completes.Dependencies
AcquireLock/ReleaseLock/IsAvailableRPCs and the locked-retry routing gates (which were the consumers of these methods and the last readers of thebackoff/lockedfields); without it, this change does not compile.Part of #33. Depends on: #40