Skip to content

Disable RandomRangeLock in Watches workload - #12044

Closed
spraza wants to merge 1 commit into
apple:mainfrom
spraza:r146970225-fix
Closed

spraza wants to merge 1 commit into
apple:mainfrom
spraza:r146970225-fix

Conversation

@spraza

@spraza spraza commented Mar 20, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Update: See #12044 (comment).

The Watches workload creates a chain of nodes (key-value pairs). It's the job of watcher actor to then propagate value from node i to node i+1. Eventually the value should propagate all the way to the end of the chain. The watchesWorker actor has a watch on the end node's key.

RandomRangeLocks workload can lock ranges that are in this node chain keyspace. As a result, sometimes value propagation is blocked, and therefore, the watch on the end node's key never fires, causing the test to fail.

To fix this issue, I disabled RandomRangeLock workload injection in the Watches workload.

Testing

Ran Watches.toml 100K times.

Before this change: 20250320-071005-praza-r146970225-fix-6fa83c231dcb131572f2919 compressed=True data_size=35943280 duration=10151860 ended=100000 fail=3 fail_fast=10 max_runs=100000 pass=99997 priority=100 remaining=0 runtime=1:46:11 sanity=False started=100000 stopped=20250320-085616 submitted=20250320-071005 timeout=5400 username=praza-r146970225-fix-6fa83c231dcb131572f2919854f60dc710878c8e

After this change: 20250320-071151-praza-r146970225-fix-b0a8bbe9ad5bd232b8e33c1 compressed=True data_size=35942764 duration=10196524 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:42:55 sanity=False started=100000 stopped=20250320-085446 submitted=20250320-071151 timeout=5400 username=praza-r146970225-fix-b0a8bbe9ad5bd232b8e33c112d531aafccddfaf7

Code-Reviewer Section

The general pull request guidelines can be found here.

Please check each of the following things and check all boxes before accepting a PR.

  • The PR has a description, explaining both the problem and the solution.
  • The description mentions which forms of testing were done and the testing seems reasonable.
  • Every function/class/actor that was touched is reasonably well documented.

For Release-Branches

If this PR is made against a release-branch, please also check the following:

  • This change/bugfix is a cherry-pick from the next younger branch (younger release-branch or main if this is the youngest branch)
  • There is a good reason why this PR needs to go into a release branch and this reason is documented (either in the description above or in a linked GitHub issue)

@spraza
spraza marked this pull request as draft March 20, 2025 07:15
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux CentOS 7

  • Commit ID: b0a8bbe
  • Duration 0:22:25
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: b0a8bbe
  • Duration 0:40:36
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: b0a8bbe
  • Duration 0:47:34
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux CentOS 7

  • Commit ID: b0a8bbe
  • Duration 0:57:56
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: b0a8bbe
  • Duration 1:06:47
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux CentOS 7

  • Commit ID: b0a8bbe
  • Duration 1:10:18
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux CentOS 7

  • Commit ID: b0a8bbe
  • Duration 1:11:36
  • Result: ❌ FAILED
  • Error: Error while executing command: if python3 -m joshua.joshua list --stopped | grep ${ENSEMBLE_ID} | grep -q 'pass=10[0-9][0-9][0-9]'; then echo PASS; else echo FAIL && exit 1; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@kakaiu

kakaiu commented Mar 20, 2025 •

Copy link
Copy Markdown
Contributor

Can you help to explain a bit more about why RandomRangeLock matters? The RandomRangeLock workload should remove the lock after a certain period since the range is lock. @spraza cc. @jzhou77

Can you help to check the existence of InjectRangeUnlocked trace event in the problematic test?

@kakaiu
kakaiu self-requested a review March 20, 2025 17:45
// all the way to the end of the chain. The watchesWorker actor has a watch on the end node's key.
// RandomRangeLocks workload can lock ranges that are in this node chain keyspace. As a result, sometimes
// value propagation is blocked, and therefore, the watch on the end node's key never fires, causing
// the test to fail. To fix this issue, we disable RandomRangeLock workload injection.

@kakaiu kakaiu Mar 20, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RandomRangeLocks workload should unlock the locked range after a certain period. Does the "unlock" happens in the simulation failure? InjectRangeUnlocked trace event is generated when the workload conducts unlock. Thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all ranges are unlocked, example:

$ grep "InjectRangeLocked" trace.0.0.0.0.318484.1742495421.27ZPM4.0.1.xml | nl
     1  <Event Severity="30" Time="180.162209" DateTime="2025-03-20T18:30:31Z" Type="InjectRangeLocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner4" Range="\x003hS\x12 - \x0d\xd2\x14" LockTime="30.1681" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     2  <Event Severity="30" Time="220.668976" DateTime="2025-03-20T18:30:32Z" Type="InjectRangeLocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner0" Range="L\\ - \xf8\xffX\x9c\xe1" LockTime="49.1955" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     3  <Event Severity="30" Time="255.632384" DateTime="2025-03-20T18:30:32Z" Type="InjectRangeLocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner0" Range="\x02\x82 - \xddX\xa2\x85" LockTime="49.3799" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     4  <Event Severity="30" Time="297.289657" DateTime="2025-03-20T18:30:33Z" Type="InjectRangeLocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner1" Range="Y\xa8 - \xe1LfA\xf3M" LockTime="49.4873" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     5  <Event Severity="30" Time="354.484869" DateTime="2025-03-20T18:30:34Z" Type="InjectRangeLocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner5" Range="\xde\xd8\xff\x92L\xcd\xb7\x1a\xfa - \xef\xceu" LockTime="57.9557" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />

$ grep "InjectRangeUnlocked" trace.0.0.0.0.318484.1742495421.27ZPM4.0.1.xml | nl
     1  <Event Severity="30" Time="210.389686" DateTime="2025-03-20T18:30:31Z" Type="InjectRangeUnlocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner4" Range="\x003hS\x12 - \x0d\xd2\x14" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     2  <Event Severity="30" Time="270.228781" DateTime="2025-03-20T18:30:33Z" Type="InjectRangeUnlocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner0" Range="L\\ - \xf8\xffX\x9c\xe1" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     3  <Event Severity="30" Time="347.334423" DateTime="2025-03-20T18:30:34Z" Type="InjectRangeUnlocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner1" Range="Y\xa8 - \xe1LfA\xf3M" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />
     4  <Event Severity="30" Time="413.018530" DateTime="2025-03-20T18:30:36Z" Type="InjectRangeUnlocked" Machine="[abcd::3:4:3:7]:1" ID="0000000000000000" RangeLockOwnerName="Owner5" Range="\xde\xd8\xff\x92L\xcd\xb7\x1a\xfa - \xef\xceu" ThreadID="14508403140788913063" LogGroup="default" Roles="TS" />

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the expectation that RandomRangeLock workload always unlocks all ranges that it locked earlier? If so, the fix should be in that workload.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The workload should be fixed. The expected behavior of the workload should be unlocking all range locked by the workload.

@spraza spraza Mar 20, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @kakaiu about the lock semantics as well as the lock workload. Summary:

  1. This is an "exclusive read lock", meaning there can be 1 reader per range. So we disallow more than 1 lock for an overlapping range. However, we do not disallow this behavior for the same owner i.e. the same owner can take a read lock on overlapping range twice. But, the unlock is rejected for one instance of this owner lock. See "Owner0" lock/unlock traces above. The unlock is failing with error_code_range_locked_by_different_user.
  2. We attempt to unlock ranges that we were not able to lock before (got lock rejected). Customers should not do this, but it tests API misuse. From a workload perspective, it's ok, just a bit inefficient.

The main issue is (1). @kakaiu is going to investigate. It could be a range lock workload issue or a bug in range lock code, we're not sure yet.

@spraza

spraza commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator Author

Fixed by #12047. Context: #12044 (comment). Closing this PR.

@spraza spraza closed this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants