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

Refactor etcd config as discovery section with convenience types #2843

Merged
merged 51 commits into from
Nov 9, 2020

Conversation

rallen090
Copy link
Collaborator

@rallen090 rallen090 commented Nov 6, 2020

What this PR does / why we need it:

This change makes the etcd config easier to define in the common use-cases with default values. These include

  • m3db single node
  • m3db cluster
  • m3aggregator cluster

And then we have the traditional definition still supported via

discovery:
  config: ...

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?:


@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #2843 into master will decrease coverage by 0.0%.
The diff coverage is 71.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2843     +/-   ##
========================================
- Coverage    72.1%   72.1%   -0.1%     
========================================
  Files        1101    1101             
  Lines      101630   99857   -1773     
========================================
- Hits        73351   72009   -1342     
+ Misses      23319   22909    -410     
+ Partials     4960    4939     -21     
Flag Coverage Δ
aggregator 75.7% <ø> (-0.1%) ⬇️
cluster 84.9% <ø> (+<0.1%) ⬆️
collector 84.3% <ø> (ø)
dbnode 79.3% <82.6%> (+0.1%) ⬆️
m3em 74.4% <ø> (ø)
m3ninx 73.1% <ø> (ø)
metrics 17.2% <ø> (ø)
msg 74.2% <ø> (ø)
query 68.8% <0.0%> (-0.1%) ⬇️
x 80.1% <ø> (-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 2b72516...83be2c5. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #2843 (5a40a30) into master (5a40a30) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2843   +/-   ##
======================================
  Coverage    72.1%   72.1%           
======================================
  Files        1099    1099           
  Lines       99827   99827           
======================================
  Hits        72006   72006           
  Misses      22888   22888           
  Partials     4933    4933           
Flag Coverage Δ
aggregator 75.9% <0.0%> (ø)
cluster 85.0% <0.0%> (ø)
collector 84.3% <0.0%> (ø)
dbnode 79.3% <0.0%> (ø)
m3em 74.4% <0.0%> (ø)
m3ninx 73.1% <0.0%> (ø)
metrics 17.2% <0.0%> (ø)
msg 74.2% <0.0%> (ø)
query 68.9% <0.0%> (ø)
x 80.3% <0.0%> (ø)

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 5a40a30...7bfe97d. Read the comment docs.

@robskillington robskillington changed the base branch from master to refactor-config-use-defaults-wherever-possible November 7, 2020 05:36
Base automatically changed from refactor-config-use-defaults-wherever-possible to master November 7, 2020 05:48
Comment on lines +94 to +97
case M3DBSingleNodeType:
return "m3db_single_node"
case M3DBClusterType:
return "m3db_cluster"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to disambiguate between these two cases at this level? Can we do the right thing based on whether the provided cluster config has 1 or >1 entries?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately not, for m3db_single_node case the etcd configuration is not specified (to make this reduced config possible). When m3db_single_node is set it knows without specifying the local host address as the etcd to connect to (i.e. you haven't connected to etcd yet to infer that there's a single node present, you need to inform DB that you are expecting a single node and then it can follow the behavior of connecting to etcd on the embedded DB node instead of making you type out in config the etcd address).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see what you mean now - makes sense.

.golangci.yml Outdated
Comment on lines 215 to 217
# New line required before return would require a large fraction of the
# code base to need updating, it's not worth the perceived benefit.
- nlreturn
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's cut this separately, please

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure thing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Opened #2865.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Stamped, thanks!

Copy link
Collaborator

@robskillington robskillington left a comment

Choose a reason for hiding this comment

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

LGTM

@robskillington robskillington merged commit ec68e83 into master Nov 9, 2020
@robskillington robskillington deleted the ra/etcd-config-as-discovery-section branch November 9, 2020 21:07
soundvibe added a commit that referenced this pull request Nov 11, 2020
* master: (28 commits)
  [dbnode] Add claims for index segments volume index (#2846)
  [dbnode] Remove namespaces from example config and integration tests (#2866)
  [dbnode] Resurrect flaky test skip (#2868)
  [aggregator] Fix checkCampaignStateLoop (#2867)
  [dbnode] implement deletion method in namespace kvadmin service (#2861)
  Replace closer with resource package (#2864)
  Add coding style guide (#2831)
  Add GOVERNANCE.md to describe governance (#2830)
  Add COMPATIBILITY.md to describe version compatibility (#2829)
  Refactor etcd config as discovery section with convenience types (#2843)
  Refactor x/lockfile into dbnode/server (#2862)
  [lint] Disable nlreturn linter (#2865)
  [m3cluster] Expose placement algorithm in placement service (#2858)
  [etcd] Set reasonable cluster connection/sync settings by default (#2860)
  [dbnode] Use bits.LeadingZeros64 to improve encoder performance (#2857)
  Cleanup m3nsch leftovers (#2856)
  Update ci-scripts to correct coverage tracking (#2854)
  [aggregator] Process campaign state without waiting for first campaign check interval (#2855)
  Bump go to 1.14 (#2853)
  [query] Remove single series error from M3
  ...
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.

4 participants