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] Prevent tcp client panic on nil placement #3139

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

jcerniauskas
Copy link
Contributor

What this PR does / why we need it:
When TCP Client fails to get placement from KV (f.e. on network partition) on Init() it will return an error, but placementWatcher still does the right thing and tries to reconnect to KV. Before it does so, however, it will return a nil stagedPlacement and any other client methods which read the placement will panic due to NPE.

This PR makes it return an error instead, so client's callers can retry writes on errors and once connection to KV is restored the client will pick up the placement.

Special notes for your reviewer:

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

NONE

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

NONE

@CLAassistant
Copy link

CLAassistant commented Jan 29, 2021

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jan 29, 2021

Codecov Report

Merging #3139 (e108bf7) into master (922a33b) will increase coverage by 1.4%.
The diff coverage is 42.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #3139     +/-   ##
=========================================
+ Coverage    70.8%    72.2%   +1.4%     
=========================================
  Files        1083     1084      +1     
  Lines      100219   100242     +23     
=========================================
+ Hits        71005    72437   +1432     
+ Misses      24139    22753   -1386     
+ Partials     5075     5052     -23     
Flag Coverage Δ
aggregator 75.8% <42.8%> (+<0.1%) ⬆️
cluster 84.8% <ø> (-0.1%) ⬇️
collector 84.3% <ø> (ø)
dbnode 78.7% <ø> (+3.4%) ⬆️
m3em 74.4% <ø> (ø)
m3ninx 73.1% <ø> (-0.1%) ⬇️
metrics 20.0% <ø> (ø)
msg 73.8% <ø> (-0.4%) ⬇️
query 67.2% <ø> (ø)
x 80.3% <ø> (-0.1%) ⬇️

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 922a33b...e108bf7. Read the comment docs.

@vdarulis vdarulis merged commit c8ce265 into master Feb 1, 2021
@vdarulis vdarulis deleted the justas/agg-init-resiliency branch February 1, 2021 14:59
SokolAndrey pushed a commit to SokolAndrey/m3 that referenced this pull request Feb 2, 2021
soundvibe added a commit that referenced this pull request Feb 2, 2021
* master:
  [dbnode] Remove unused Shard.ScanData method (#3148)
  [tests] Add option to skip setup for docker integration tests (#3146)
  [dbnode] Add source propagation to aggregate query (#3153)
  [aggregator] Prevent tcp client panic on nil placement (#3139)
soundvibe added a commit that referenced this pull request Feb 2, 2021
* master:
  [dbnode] Remove unused Shard.ScanData method (#3148)
  [tests] Add option to skip setup for docker integration tests (#3146)
  [dbnode] Add source propagation to aggregate query (#3153)
  [aggregator] Prevent tcp client panic on nil placement (#3139)
  [dtest] endpoint to fetch tagged (#3138)
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.

3 participants