-
Notifications
You must be signed in to change notification settings - Fork 455
remove batchSize and limit from isMaster #750
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #750 +/- ##
==========================================
- Coverage 60.91% 60.86% -0.05%
==========================================
Files 278 278
Lines 73398 73400 +2
==========================================
- Hits 44709 44674 -35
- Misses 28689 28726 +37
Continue to review full report at Codecov.
|
static mongoc_cursor_t * | ||
_make_cmd_deprecated_cursor (mongoc_collection_t *coll); | ||
|
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.
Forward declared so we can reference it on lines 314 and 328.
* of MongoDB that doesn't support read/write concerns, and we are only | ||
* interested in testing if the clone process works. */ |
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.
clang-format
ASSERT (mongoc_write_concern_get_wtimeout_int64 (cloned->write_concern) == | ||
1000); |
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.
clang-format
@@ -316,10 +321,11 @@ _test_common_opts (void *ctx) | |||
mongoc_cursor_set_max_await_time_ms (cursor, 3); | |||
ASSERT_CMPINT (mongoc_cursor_get_max_await_time_ms (cursor), ==, 3); | |||
/* prime the cursor. */ | |||
BSON_ASSERT (mongoc_cursor_next (cursor, &doc)); | |||
ASSERT_OR_PRINT (mongoc_cursor_next (cursor, &doc), cursor->error); |
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.
This helped debug the issue. If this fails again, we'd definitely want the cursor's error message.
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.
+1
@@ -305,8 +309,9 @@ _test_common_opts (void *ctx) | |||
BSON_ASSERT (mongoc_cursor_set_hint (cursor, sd->id)); | |||
ASSERT_CMPINT (mongoc_cursor_get_hint (cursor), ==, sd->id); | |||
|
|||
/* listDatabases prohibits limit and batchSize */ | |||
if ((make_cursor_fn) ctx != _make_array_cursor) { | |||
/* listDatabases and isMaster prohibits limit and batchSize */ |
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.
Added "isMaster".
The issue was caused by the if guards changed below. _make_cmd_deprecated_cursor
creates a cursor with an "isMaster" command. Since "isMaster" commands - like the "listDatabases" referenced here - do not accept a "batchSize" or "limit", the server errored with the message (paraphrased) "batchSize (or limit) option not found".
LGTM! |
@@ -316,10 +321,11 @@ _test_common_opts (void *ctx) | |||
mongoc_cursor_set_max_await_time_ms (cursor, 3); | |||
ASSERT_CMPINT (mongoc_cursor_get_max_await_time_ms (cursor), ==, 3); | |||
/* prime the cursor. */ | |||
BSON_ASSERT (mongoc_cursor_next (cursor, &doc)); | |||
ASSERT_OR_PRINT (mongoc_cursor_next (cursor, &doc), cursor->error); |
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.
+1
This commit fixes the failing
cmd_deprecated
tasks on Evergreen (here for example).