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: Concurrency control of Document using RWMutex #213

Merged
merged 6 commits into from
Mar 4, 2022

Conversation

orpheuslummis
Copy link
Contributor

@orpheuslummis orpheuslummis commented Feb 15, 2022

Inclusion of a reader/writer mutual exclusion lock on Document and its set operation.

Submitting as draft PR as to obtain feedback first, then iterate & submit as normal PR.

@orpheuslummis orpheuslummis added this to the DefraDB v0.2.1 milestone Feb 15, 2022
@orpheuslummis orpheuslummis self-assigned this Feb 15, 2022
@orpheuslummis
Copy link
Contributor Author

closes #7

@orpheuslummis orpheuslummis linked an issue Feb 15, 2022 that may be closed by this pull request
@orpheuslummis orpheuslummis changed the title fix: RWMutex on Document set operation fix: Concurrency control of Document using RWMutex Feb 17, 2022
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #213 (beb2694) into develop (42a3b8b) will increase coverage by 0.07%.
The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #213      +/-   ##
===========================================
+ Coverage    58.57%   58.64%   +0.07%     
===========================================
  Files          103      103              
  Lines         9846     9864      +18     
===========================================
+ Hits          5767     5785      +18     
  Misses        3449     3449              
  Partials       630      630              
Impacted Files Coverage Δ
document/document.go 66.78% <90.90%> (+2.25%) ⬆️

@orpheuslummis orpheuslummis marked this pull request as ready for review February 25, 2022 17:12
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Looks good, but I think this is still slightly incorrect - see comment on Key()

document/document.go Show resolved Hide resolved
@orpheuslummis
Copy link
Contributor Author

Didn't spot a difference in running benchmarks cold,hot develop vs cold,hot this branch

@orpheuslummis
Copy link
Contributor Author

(latest force-push is just a conflict-free rebase of the same thing)

Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

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

Looks simple enough. LGTM

document/document.go Show resolved Hide resolved
@orpheuslummis orpheuslummis merged commit 2b3d0b0 into develop Mar 4, 2022
@orpheuslummis orpheuslummis deleted the orpheus/document-ops-locking branch March 4, 2022 18:54
jsimnz pushed a commit that referenced this pull request Mar 4, 2022
Inclusion of a reader/writer mutual exclusion lock on Document and its set operation.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
Inclusion of a reader/writer mutual exclusion lock on Document and its set operation.
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.

Apply locking on Document field/value operations
3 participants