LOCK IN SHARE MODEIn this blog post, we’ll look at MyRocks and the LOCK IN SHARE MODE.

Those who attended the March 30th webinar “MyRocks Troubleshooting” might remember our discussion with Yoshinori on  LOCK IN SHARE MODE.

I did more tests, and I can confirm that his words are true: LOCK IN SHARE MODE works in MyRocks.

This quick example demonstrates this. The initial setup:

In session 1:

In session 2:

However, in the webinar I wanted to remind everyone about the differences between LOCK IN SHARE MODE  and FOR UPDATE. To do so, I added the former to my “session 2” test for the webinar. Once I did, it ignores the lock set in “session 1”. I can update a row and commit:

I reported this behavior here, and also at Percona Jira bugs database: MYR-107. In Facebook, this bug is already fixed.

This test clearly demonstrates that it is fixed in Facebook. In “session 1”:

And now in another session:

If you want to test the fix with the Facebook MySQL build, you need to update submodules to download the patch: git submodule update.