-
Notifications
You must be signed in to change notification settings - Fork 455
CDRIVER-5780 Support QE with Client.bulkWrite #2043
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
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "8.0", | ||
"serverless": "forbid" |
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.
I expect this test needs a csfle: true
requirement. That might fix test failures on non-cse
tasks. Example:
libmongoc is not built with support for Client-Side Field Level Encryption
@@ -423,6 +426,7 @@ test_bson_size_limits_and_batch_splitting (void *unused) | |||
coll = mongoc_client_get_collection (client, "db", "coll"); | |||
/* End of setup */ | |||
|
|||
/* Case 1 */ |
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.
Suggest removing "Case 1" and "Case 2" comments. AFAICT they do not refer to the prose tests directly. Whereas some other prose tests have cases (example).
// Create a newly named collection to avoid cached previous JSON Schema. | ||
mongoc_collection_t *coll2 = mongoc_database_create_collection (db, "coll2", coll_opts, &error); | ||
ASSERT_OR_PRINT (coll2, error); | ||
mongoc_collection_destroy(coll2); |
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.
mongoc_collection_destroy(coll2); | |
mongoc_collection_destroy (coll2); |
Aside: clang-format can be run with:
./tools/poetry.sh install --with=dev
./tools/poetry.sh run .evergreen/scripts/clang-format-all.sh
But that is likely to be replaced soon with #2039:
uv run --frozen --only-group format .evergreen/scripts/clang-format-all.sh
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 --only-group format
flag is optional. Dev dependencies are included by default with uv.
mongoc_bulkwriteexception_destroy (bwr.exc); | ||
|
||
/* Insert two documents that each exceed 2MiB after encryption occurs. Expect | ||
* the bulk write to succeed and run as two separate inserts. |
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 bulk write to succeed and run as two separate inserts. | |
* the bulk write to succeed and run as two separate bulkWrite commands. |
@@ -340,14 +344,15 @@ _command_started (const mongoc_apm_command_started_t *event) | |||
limits_apm_ctx_t *ctx; | |||
|
|||
ctx = (limits_apm_ctx_t *) mongoc_apm_command_started_get_context (event); | |||
if (0 == strcmp ("insert", mongoc_apm_command_started_get_command_name (event))) { | |||
const char *cmd_name = mongoc_apm_command_started_get_command_name(event); | |||
if (0 == strcmp ("insert", cmd_name) || 0 == strcmp("bulkWrite", cmd_name)) { |
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.
Suggest using a separate counter ctx->num_bulk_writes
to distinguish insert operations from bulkWrite operations (which may not necessary be an insert).
if (0 == strcmp ("insert", cmd_name)) {
ctx->num_inserts++;
}
if (0 == strcmp ("bulkWrite", cmd_name)) {
ctx->num_bulk-writes++;
}
// Create a newly named collection to avoid cached previous JSON Schema. | ||
mongoc_collection_t *coll2 = mongoc_database_create_collection (db, "coll2", coll_opts, &error); | ||
ASSERT_OR_PRINT (coll2, error); | ||
mongoc_collection_destroy(coll2); |
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 --only-group format
flag is optional. Dev dependencies are included by default with uv.
https://spruce.mongodb.com/version/68520780d3481b00077a67cf