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

storage/bulk,storagebase: add BulkAdderOptions struct #39496

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

dt
Copy link
Member

@dt dt commented Aug 9, 2019

The signature on this is hard to modify as it is plumbed though in several places,
and as a result, many flags that control one behavior or another, like if SSTs
should be added disallowing duplicates, were being mutated via 'Set' functions
that were starting to get messy.

By making a options struct that is in the signature used and plumbed through all
the sql/distsql/etc layers, any new flags can be added here with minimal extra
work involved.

Release note: none.

@dt dt requested a review from adityamaru27 August 9, 2019 20:51
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@adityamaru27 adityamaru27 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt)


pkg/sql/distsqlrun/bulk_row_writer.go, line 76 at r1 (raw file):

func (sp *bulkRowWriter) ingestLoop(ctx context.Context, kvCh chan []roachpb.KeyValue) error {
	writeTS := sp.spec.Table.CreateAsOfTime
	const bufferSize = 64 << 20

was increasing the flushSize to 32MB intentional (since you're not passing it in as an option)?


pkg/storage/bulk/buffering_adder.go, line 58 at r1 (raw file):

	opts storagebase.BulkAdderOptions,
) (*BufferingAdder, error) {
	if opts.BufferSize == 0 {

Should we keep the check for negative flushBytes and sstBytes to prevent unintended usage?

Copy link
Member Author

@dt dt left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru27)


pkg/sql/distsqlrun/bulk_row_writer.go, line 76 at r1 (raw file):

Previously, adityamaru27 (Aditya Maru) wrote…

was increasing the flushSize to 32MB intentional (since you're not passing it in as an option)?

whoops, nope... but I think I'm okay with it, since AFAIK, this wasn't picked for a specific reason so letting the adder use its default feels fine to me.


pkg/storage/bulk/buffering_adder.go, line 58 at r1 (raw file):

Previously, adityamaru27 (Aditya Maru) wrote…

Should we keep the check for negative flushBytes and sstBytes to prevent unintended usage?

could make them uint64 instead?

Copy link
Contributor

@adityamaru27 adityamaru27 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt)


pkg/storage/bulk/buffering_adder.go, line 58 at r1 (raw file):

Previously, dt (David Taylor) wrote…

could make them uint64 instead?

SGTM

The signature on this is hard to modify as it is plumbed though in several places,
and as a result, many flags that control one behavior or another, like if SSTs
should be added disallowing duplicates, were being mutated via 'Set' functions
that were starting to get messy.

By making a options struct that is in the signature used and plumbed through all
the sql/distsql/etc layers, any new flags can be added here with minimal extra
work involved.

Release note: none.
@adityamaru27
Copy link
Contributor

bors r+

craig bot pushed a commit that referenced this pull request Aug 12, 2019
39496: storage/bulk,storagebase: add BulkAdderOptions struct r=adityamaru27 a=dt

The signature on this is hard to modify as it is plumbed though in several places,
and as a result, many flags that control one behavior or another, like if SSTs
should be added disallowing duplicates, were being mutated via 'Set' functions
that were starting to get messy.

By making a options struct that is in the signature used and plumbed through all
the sql/distsql/etc layers, any new flags can be added here with minimal extra
work involved.

Release note: none.

Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@craig
Copy link
Contributor

craig bot commented Aug 12, 2019

Build succeeded

@craig craig bot merged commit c7b8288 into cockroachdb:master Aug 12, 2019
@dt dt deleted the adder-config branch August 16, 2019 19:40
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