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

[aggregator] Move placement checks to a background job #3315

Merged
merged 2 commits into from
Mar 3, 2021
Merged

Conversation

vdarulis
Copy link
Collaborator

@vdarulis vdarulis commented Mar 3, 2021

What this PR does / why we need it:

This change reduces lock contention by doing less work on the hot path. It also changes the error returned in some cases to shard not owned, not aggregator is not open - the difference is a semantic one, since it's just a guard against initialization bugs.

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@vdarulis vdarulis requested a review from abliqo March 3, 2021 06:37
Comment on lines -353 to -355
if agg.electionManager.ElectionState() == FollowerState {
return writer.NewBlackholeWriter(), nil
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should be fine to remove this 2nd check, as double-writing metrics in this rare case is not the end of the world.

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #3315 (fd137c8) into master (2bbbd0f) will increase coverage by 0.1%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #3315     +/-   ##
=========================================
+ Coverage    72.3%    72.5%   +0.1%     
=========================================
  Files        1099     1099             
  Lines      101732   101512    -220     
=========================================
+ Hits        73584    73600     +16     
+ Misses      23062    22833    -229     
+ Partials     5086     5079      -7     
Flag Coverage Δ
aggregator 76.5% <87.3%> (+<0.1%) ⬆️
cluster 84.9% <100.0%> (ø)
collector 84.3% <ø> (ø)
dbnode 78.9% <ø> (+<0.1%) ⬆️
m3em 74.4% <ø> (-5.3%) ⬇️
m3ninx 73.5% <ø> (+0.1%) ⬆️
metrics 19.9% <ø> (ø)
msg 74.2% <ø> (+0.1%) ⬆️
query 67.4% <ø> (+0.5%) ⬆️
x 80.5% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bbbd0f...fd137c8. Read the comment docs.

@vdarulis vdarulis merged commit b24eccc into master Mar 3, 2021
@vdarulis vdarulis deleted the v/aggshard branch March 3, 2021 07:35
soundvibe added a commit that referenced this pull request Mar 3, 2021
* master:
  [aggregator] Move placement checks to a background job (#3315)
  [tests] Remove a few more usages of NoOpAllBootstrapper from tests (#3314)
  [coordinator] make drop timestamp apply to the metric rather than specific rule (#3310)
  Update server.go (#3298)
  Fix Data Race in checkoutSeriesWithLock (#3300)
  [query] Allow configuration of placement options (#3304)
vpranckaitis added a commit that referenced this pull request Apr 23, 2021
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.

2 participants