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

Implement (opt-in) WriteBatchRawV2 that can batch across namespaces #1974

Merged
merged 6 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cmd/services/m3dbnode/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ func TestConfiguration(t *testing.T) {
asyncWriteMaxConcurrency: null
targetHostQueueFlushSize: null
hostQueueFlushInterval: null
useV2BatchAPIs: null
gcPercentage: 100
writeNewSeriesLimitPerSecond: 1048576
writeNewSeriesBackoffDuration: 2ms
Expand Down
56 changes: 56 additions & 0 deletions src/dbnode/client/client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/dbnode/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ type Configuration struct {
// HostQueueFlushInterval sets the interval at which the m3db client will flush the queue for a
// given host regardless of the number of batched operations.
HostQueueFlushInterval *time.Duration `yaml:"hostQueueFlushInterval"`

// UseV2BatchAPIs determines whether the V2 batch APIs are used. Note that the M3DB nodes must
// have support for the V2 APIs in order for this feature to be used.
UseV2BatchAPIs *bool `yaml:"useV2BatchAPIs"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking about this in the long term, is this sustainable? The config might be littered with different versions for different sets of APIs and it could get very messy. How about just a single APIVersion *string where users will put in "0.2.3" or something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plan is to deprecate the old APIs soon so I'm not super worried about it but I can make it a string. I'll probably keep it a bool in the guts of the codebase though just to keep things simple

}

// ProtoConfiguration is the configuration for running with ProtoDataMode enabled.
Expand Down Expand Up @@ -306,6 +310,10 @@ func (c Configuration) NewAdminClient(
SetChannelOptions(xtchannel.NewDefaultChannelOptions()).
SetInstrumentOptions(iopts)

if c.UseV2BatchAPIs != nil {
v = v.SetUseV2BatchAPIs(*c.UseV2BatchAPIs)
}

if buildAsyncPool {
var size int
if c.AsyncWriteWorkerPoolSize == nil {
Expand Down
Loading