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] Use StreamingReadMetadata for bootstrapping #2938

Merged
merged 25 commits into from
Jan 25, 2021

Conversation

linasm
Copy link
Collaborator

@linasm linasm commented Nov 22, 2020

What this PR does / why we need it:
DataReaderOpenOptions had an option OptimizedReadMetadataOnly that, when enabled, was avoiding the sorting of data fileset index file after loading it into memory. This change makes a further improvement and avoids loading this file into memory altogether, by using the newly implemented StreamingReadMetadata method (which is a sister method of already existing StreamingRead).
The change affects fs/source and peers/source bootstrappers.

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 Nov 22, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2938   +/-   ##
=======================================
  Coverage    72.2%    72.2%           
=======================================
  Files        1084     1084           
  Lines      100492   100492           
=======================================
  Hits        72630    72630           
  Misses      22806    22806           
  Partials     5056     5056           
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.1% <0.0%> (ø)
metrics 20.0% <0.0%> (ø)
msg 74.2% <0.0%> (ø)
query 67.2% <0.0%> (ø)
x 80.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 fcbe585...7fb067d. Read the comment docs.

Comment on lines +469 to +470
r.streamingID = append(r.streamingID[:0], entry.ID...)
r.streamingTags = append(r.streamingTags[:0], entry.EncodedTags...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will these compete with StreamingRead also mutating these fields?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. At least for now (and most probably in the future) data and metadata reads are mutually exclusive (like it was before the introduction of streaming). This is documented in the method comments on the interface.

Comment on lines -723 to -736
id.Finalize()
tagsIter.Close()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the id and encoded tags be finalized here still, considering FromRawSeriesIDAndTags is cloning them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With streaming reads, id and tags are just raw []byte slices and thus no longer a subject to finalization.

Copy link
Collaborator

@arnikola arnikola left a comment

Choose a reason for hiding this comment

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

LGTM

@arnikola arnikola removed their assignment Dec 10, 2020
arnikola and others added 5 commits December 10, 2020 10:01
# Conflicts:
#	src/dbnode/storage/bootstrap/bootstrapper/fs/source.go
#	src/dbnode/storage/bootstrap/bootstrapper/peers/source.go
#	src/dbnode/storage/index/convert/convert.go
#	src/dbnode/storage/index/convert/convert_test.go
@vpranckaitis vpranckaitis self-assigned this Jan 20, 2021
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

@linasm linasm merged commit 358d92a into master Jan 25, 2021
@linasm linasm deleted the linasm/bootstrap-streaming-read-metadata branch January 25, 2021 17:14
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
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