diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2020-11-06 00:25:04 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-06 19:43:11 +0000 |
commit | 640a850162bfe814444b35a8b2143f78ae40e20d (patch) | |
tree | 9edc3d8ccf719d488870ee9a4e2724d63d577f51 /src/mongo/client | |
parent | d6c15c62c4335266dfd30336ae1cf582b84e09ac (diff) | |
download | mongo-640a850162bfe814444b35a8b2143f78ae40e20d.tar.gz |
SERVER-52621 Remove stale version execption handling in OpQuery exec path
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/constants.h | 4 | ||||
-rw-r--r-- | src/mongo/client/dbclient_base.cpp | 8 | ||||
-rw-r--r-- | src/mongo/client/dbclient_cursor.cpp | 12 |
3 files changed, 10 insertions, 14 deletions
diff --git a/src/mongo/client/constants.h b/src/mongo/client/constants.h index 5f282e0da7f..8e6b6228909 100644 --- a/src/mongo/client/constants.h +++ b/src/mongo/client/constants.h @@ -40,8 +40,8 @@ enum ResultFlagType { /* { $err : ... } is being returned */ ResultFlag_ErrSet = 2, - /* Have to update config from the server, usually $err is also set */ - ResultFlag_ShardConfigStale = 4, + /* Formerly used to comminicate stale version errors */ + ResultFlag_ShardConfigStaleDeprecated = 4, /* for backward compatibility: this let's us know the server supports the QueryOption_AwaitData option. if it doesn't, a repl slave client should sleep diff --git a/src/mongo/client/dbclient_base.cpp b/src/mongo/client/dbclient_base.cpp index 9f75d9c2352..5de427f1a83 100644 --- a/src/mongo/client/dbclient_base.cpp +++ b/src/mongo/client/dbclient_base.cpp @@ -739,11 +739,9 @@ void DBClientBase::findN(vector<BSONObj>& out, << " ns: " << ns << " query: " << query.toString(), c.get()); - if (c->hasResultFlag(ResultFlag_ShardConfigStale)) { - BSONObj error; - c->peekError(&error); - uasserted(StaleConfigInfo::parseFromCommandError(error), "findN stale config"); - } + tassert(5262100, + "Deprecated ShardConfigStale flag encountered in query result", + !c->hasResultFlag(ResultFlag_ShardConfigStaleDeprecated)); for (int i = 0; i < nToReturn; i++) { if (!c->more()) diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp index 8031febcffa..10e7ad1adf9 100644 --- a/src/mongo/client/dbclient_cursor.cpp +++ b/src/mongo/client/dbclient_cursor.cpp @@ -363,11 +363,11 @@ void DBClientCursor::dataReceived(const Message& reply, bool& retry, string& hos QueryResult::View qr = reply.singleData().view2ptr(); resultFlags = qr.getResultFlags(); - if (qr.getResultFlags() & ResultFlag_ErrSet) { + if (resultFlags & ResultFlag_ErrSet) { wasError = true; } - if (qr.getResultFlags() & ResultFlag_CursorNotFound) { + if (resultFlags & ResultFlag_CursorNotFound) { // cursor id no longer valid at the server. invariant(qr.getCursorId() == 0); @@ -408,11 +408,9 @@ void DBClientCursor::dataReceived(const Message& reply, bool& retry, string& hos _client->checkResponse(batch.objs, false, &retry, &host); // watches for "not primary" - if (qr.getResultFlags() & ResultFlag_ShardConfigStale) { - BSONObj error; - verify(peekError(&error)); - uasserted(StaleConfigInfo::parseFromCommandError(error), "stale config on lazy receive"); - } + tassert(5262101, + "Deprecated ShardConfigStale flag encountered in query result", + !(resultFlags & ResultFlag_ShardConfigStaleDeprecated)); /* this assert would fire the way we currently work: verify( nReturned || cursorId == 0 ); |