Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bigtable/bttest): fix locking bug in DropRowRange #4200

Closed
wants to merge 1 commit into from

Conversation

dragonsinth
Copy link
Contributor

DropRowRange's locking is inconsistent with the rest of bttest
#2600

ModifyColumnFamilies demonstrates the correct pattern:

  • Use the server global mutex to reference the table by name
  • Use the table's mutex to guard data reads and writes.

The existing implementation can data race if another concurrently running method (such as SampleRowKeys)
has already dropped the server mutex and acquired the table mutex. Nothing then prevents DropRowRange
from mutating table data during a Sample or Scan.

DropRowRange's locking is inconsistent with the rest of bttest
googleapis#2600

ModifyColumnFamilies demonstrates the correct pattern:
- Use the server global mutex to reference the table by name
- Use the table's mutex to guard data reads and writes.

The existing implementation can data race if another concurrently running method (such as SampleRowKeys)
has already dropped the server mutex and acquired the table mutex.  Nothing then prevents DropRowRange
from mutating table data during a Sample or Scan.
@dragonsinth dragonsinth requested review from crwilcox, kolea2, tritone and a team as code owners June 2, 2021 20:21
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 2, 2021
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Jun 2, 2021
@tritone
Copy link
Contributor

tritone commented Jun 3, 2021

Thanks very much for the fix here! I'm going to close in favor of #4207 which includes a test that reproduces the issue as well.

@tritone tritone closed this Jun 3, 2021
@dragonsinth
Copy link
Contributor Author

Sweet! Thank you.

@dragonsinth dragonsinth deleted the bttest-drop-race branch June 4, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants