-
Notifications
You must be signed in to change notification settings - Fork 916
GODRIVER-3522 Add support for the rawData option for time-series bucket access. #2159
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
base: master
Are you sure you want to change the base?
Conversation
The pull-request-helpers failure is due to the branch being outdated compared to master. Merging in changes from master should solve this problem. |
API Change Report./v2/mongo/optionsincompatible changesBulkWriteOptions: old is comparable, new is not compatible changesAggregateOptions.Internal: added ./v2/x/mongo/driver/operationcompatible changes(*Aggregate).RawData: added ./v2/x/mongo/driver/xoptionscompatible changesSetInternalAggregateOptions: added |
…ntCount, delete, distinct, and insert (#2121)
6c43dc5
to
77e93be
Compare
77e93be
to
5360234
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add support for the rawData
option for time-series bucket access to MongoDB operations. This enables accessing time-series data in compressed format for MongoDB 8.2+ servers.
- Adds
rawData
field to multiple operation structs and their corresponding command builders - Updates options structs to include
Internal
field for storing internal options likerawData
- Implements version checking to only send
rawData
to MongoDB 8.2+ servers (wire version 27)
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
x/mongo/driver/xoptions/options.go | Added support functions for setting rawData internal option across multiple operation types |
x/mongo/driver/xoptions/options_test.go | Updated error messages to use quoted format for consistency |
x/mongo/driver/operation/*.go | Added rawData field and command support to various operations (update, insert, find, etc.) |
mongo/options/*.go | Added Internal field to options structs for storing internal configuration |
mongo/*.go | Updated operation execution to check for and apply rawData option from internal configuration |
internal/integration/unified/*.go | Added test support for rawData option in unified test framework |
type DropIndexesOptions struct { | ||
// Deprecated: This option is for internal use only and should not be set. It may be changed or removed in any | ||
// release. | ||
Internal optionsutil.Options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The DropIndexesOptions struct change from an empty struct to one with an Internal field is inconsistent with the other changes in this file. Consider making this change in a separate commit to maintain clarity of the PR's purpose.
Internal optionsutil.Options |
Copilot uses AI. Check for mistakes.
@@ -375,6 +386,13 @@ func (coll *Collection) InsertOne(ctx context.Context, document interface{}, | |||
if args.Comment != nil { | |||
imOpts.SetComment(args.Comment) | |||
} | |||
if rawDataOpt := optionsutil.Value(args.Internal, "rawData"); rawDataOpt != nil { | |||
imOpts.Opts = append(imOpts.Opts, func(opts *options.InsertManyOptions) error { | |||
optionsutil.WithValue(opts.Internal, "rawData", rawDataOpt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value of optionsutil.WithValue is not being assigned back to opts.Internal. This should be opts.Internal = optionsutil.WithValue(opts.Internal, "rawData", rawDataOpt)
to properly set the internal option.
optionsutil.WithValue(opts.Internal, "rawData", rawDataOpt) | |
opts.Internal = optionsutil.WithValue(opts.Internal, "rawData", rawDataOpt) |
Copilot uses AI. Check for mistakes.
@@ -209,6 +210,10 @@ func (bw *bulkWrite) runInsert(ctx context.Context, batch bulkWriteBatch) (opera | |||
} | |||
op = op.Retry(retry) | |||
|
|||
if bw.rawData != nil { | |||
op.RawData(*bw.rawData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value of op.RawData() is not being assigned back to op. This should be op = op.RawData(*bw.rawData)
to properly chain the method call.
op.RawData(*bw.rawData) | |
op = op.RawData(*bw.rawData) |
Copilot uses AI. Check for mistakes.
@@ -282,6 +287,10 @@ func (bw *bulkWrite) runDelete(ctx context.Context, batch bulkWriteBatch) (opera | |||
} | |||
op = op.Retry(retry) | |||
|
|||
if bw.rawData != nil { | |||
op.RawData(*bw.rawData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value of op.RawData() is not being assigned back to op. This should be op = op.RawData(*bw.rawData)
to properly chain the method call.
op.RawData(*bw.rawData) | |
op = op.RawData(*bw.rawData) |
Copilot uses AI. Check for mistakes.
@@ -415,6 +424,10 @@ func (bw *bulkWrite) runUpdate(ctx context.Context, batch bulkWriteBatch) (opera | |||
} | |||
op = op.Retry(retry) | |||
|
|||
if bw.rawData != nil { | |||
op.RawData(*bw.rawData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value of op.RawData() is not being assigned back to op. This should be op = op.RawData(*bw.rawData)
to properly chain the method call.
op.RawData(*bw.rawData) | |
op = op.RawData(*bw.rawData) |
Copilot uses AI. Check for mistakes.
GODRIVER-3522
Summary
Add support for the
rawData
option for time-series bucket access.Background & Motivation
With PRs:
#2121
#2123
#2155