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

[CBRD-20451] lf_freelist_claim: start lock-free transaction. #205

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

ribram
Copy link
Contributor

@ribram ribram commented Aug 16, 2016

http://jira.cubrid.org/browse/CBRD-20451

Lock-free freelist claim: start a lock-free transaction (if it was not started yet) without incrementing transaction ID.

The scenario that otherwise creates problems:

  1. t1: claim from freelist. no transaction is started. top of freelist available stack is read, next of top is read. thread is preempted before calling CAS on top with next.
  2. t2: claim top from freelist available stack.
  3. other transactions claim other entries from stack.
  4. t2: retire claimed entry back to freelist. Decide to also transport the element. Since t1 has no transaction, the entry can be transported and added back to top of available stack. However, this time next has a different value.
  5. t1: swap top with old next value. Since the old top has been recycled, the operation is successful. However, the freelist is now broken!

Special thanks to @rimio.

…t started yet) without incrementing transaction ID
@eseokoh
Copy link
Contributor

eseokoh commented Aug 16, 2016

@ribram

Great catch!
Thank you.

@rimio

Great thanks for your help.

@ribram ribram merged commit 79f7b10 into CUBRID:develop Aug 16, 2016
@ribram ribram deleted the CBRD-20451 branch August 16, 2016 14:25
@eseokoh eseokoh modified the milestone: banana pie May 12, 2017
ribram pushed a commit to ribram/cubrid that referenced this pull request May 21, 2021
https://arniadb.atlassian.net/browse/SC-408

Failure detector executable. It uses the changes made to heartbeat_cluster to communicate with db_nodes (receiving heartbeat and suspicicion messages). Failure detector periodically checks if it received hb messages from all nodes and then checks if the other nodes also did not receive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants