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

[dbnode] Alter multi-segments builder to order by size before processing #3128

Merged
merged 2 commits into from
Jan 28, 2021

Conversation

robskillington
Copy link
Collaborator

What this PR does / why we need it:

This fixes the ordering of segments by size to happen before processing (and assigning the offset to a segment) since the code that checks whether the postings list can be direct merged during postings list iterating over multi-segments checks the .offset of the segment metadata to see if it can directly using the postings.ID values without modifying (since no duplicates can be contained by the first segment with .offset == 0):

		if termsKeyIter.segment.offset == 0 {
			// No offset, which means is first segment we are combining from
			// so can just direct union
			i.currPostingsList.Union(list)
			continue
		}

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

@codecov
Copy link

codecov bot commented Jan 27, 2021

Codecov Report

Merging #3128 (eb5dfac) into master (eb5dfac) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3128   +/-   ##
=======================================
  Coverage    72.2%    72.2%           
=======================================
  Files        1084     1084           
  Lines      100298   100298           
=======================================
  Hits        72463    72463           
  Misses      22783    22783           
  Partials     5052     5052           
Flag Coverage Δ
aggregator 75.9% <0.0%> (ø)
cluster 84.8% <0.0%> (ø)
collector 84.3% <0.0%> (ø)
dbnode 78.6% <0.0%> (ø)
m3em 74.4% <0.0%> (ø)
m3ninx 73.3% <0.0%> (ø)
metrics 20.0% <0.0%> (ø)
msg 74.0% <0.0%> (ø)
query 67.2% <0.0%> (ø)
x 80.5% <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 eb5dfac...3fb012c. Read the comment docs.

@notbdu notbdu self-requested a review January 27, 2021 20:47
Copy link
Contributor

@notbdu notbdu left a comment

Choose a reason for hiding this comment

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

LGTM.

require.Equal(t, segs[i].Size(), actualSize)

if i > 0 {
// Check that offset is going up.
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, good check here.

@robskillington robskillington merged commit 75ec6dd into master Jan 28, 2021
@robskillington robskillington deleted the r/fix-segments-order-multi-segments-builder branch January 28, 2021 14:06
soundvibe added a commit that referenced this pull request Jan 29, 2021
* master:
  [dbnode] Add aggregate term limit regression test (#3135)
  [DOCS] Adding Prometheus steps to quickstart (#3043)
  [dbnode] Revert AggregateQuery changes (#3133)
  Fix TestSessionFetchIDs flaky test (#3132)
  [dbnode] Alter multi-segments builder to order by size before processing (#3128)
  [dbnode] Emit aggregate usage metrics (#3123)
  [dbnode] Add Shard.OpenStreamingReader method (#3119)
  [dtests] Docker tests integration with docker-compose (#3031)
  [dbnode] Comments / remove unused var (#3124)
  [query] Handle context.Canceled and map to 499 http status (#3069)
  [dbnode] Use StreamingReadMetadata for bootstrapping (#2938)
  [dbnode] Use DefaultTestOptions in test code (#3113)

# Conflicts:
#	src/dbnode/storage/bootstrap/bootstrapper/fs/source.go
soundvibe added a commit that referenced this pull request Feb 1, 2021
* master:
  [dtest] endpoint to fetch tagged (#3138)
  Refactor FetchTagged to return an Iterator of results (#3141)
  [dbnode] Add aggregate term limit regression test (#3135)
  [DOCS] Adding Prometheus steps to quickstart (#3043)
  [dbnode] Revert AggregateQuery changes (#3133)
  Fix TestSessionFetchIDs flaky test (#3132)
  [dbnode] Alter multi-segments builder to order by size before processing (#3128)
  [dbnode] Emit aggregate usage metrics (#3123)
  [dbnode] Add Shard.OpenStreamingReader method (#3119)
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