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

[coord] Guard against duplicate __rollup__ tags #3950

Merged
merged 4 commits into from
Dec 1, 2021

Conversation

ryanhall07
Copy link
Collaborator

Previously the tag merge logic could result in duplicate rollup tags
if the provided tags already had rollup.

Additionally refactored to lazily merge the 2 sorted slices when calling
Next(). This made it much easier to add deduping logic and I believe
makes it easier to follow the code.

What this PR does / why we need it:

Fixes #

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


Previously the tag merge logic could result in duplicate __rollup__ tags
if the provided tags already had __rollup__.

Additionally refactored to lazily merge the 2 sorted slices when calling
Next(). This made it much easier to add deduping logic and I believe
makes it easier to follow the code.
}

func (p *rollupIDProvider) CurrentIndex() int {
if p.index >= 0 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was actually broken before, so it's intentionally not backwards compatible. it would produce 0, 0, 1, 2, ...

the addition to the test proves this.

tags: []id.TagPair{
{
Name: []byte("__name__"),
Value: []byte("http_requests"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we have a different value here to demonstrate which value is chosen?

@ryanhall07 ryanhall07 enabled auto-merge (squash) December 1, 2021 02:52
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #3950 (29a3cc9) into master (29a3cc9) will not change coverage.
The diff coverage is n/a.

❗ Current head 29a3cc9 differs from pull request most recent head 90325dd. Consider uploading reports for the commit 90325dd to get more accurate results

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3950   +/-   ##
======================================
  Coverage    56.8%   56.8%           
======================================
  Files         555     555           
  Lines       63427   63427           
======================================
  Hits        36074   36074           
  Misses      24157   24157           
  Partials     3196    3196           
Flag Coverage Δ
aggregator 62.5% <0.0%> (ø)
cluster ∅ <0.0%> (∅)
collector 58.4% <0.0%> (ø)
dbnode 60.6% <0.0%> (ø)
m3em 46.4% <0.0%> (ø)
metrics 19.7% <0.0%> (ø)
msg 74.2% <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 29a3cc9...90325dd. Read the comment docs.

@ryanhall07 ryanhall07 merged commit f26c71c into master Dec 1, 2021
@ryanhall07 ryanhall07 deleted the rhall-dup-rollup-take2 branch December 1, 2021 03:28
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