diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-04-06 13:45:26 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-04-12 08:57:13 -0400 |
commit | 3389eef4cffcb07845a8d073dd825b6d40df6d9b (patch) | |
tree | bd1a12358399a542aea8f220f31ef14ed2b2b98d | |
parent | 3c7f43bc2cf5419b4061bd55351a1894a0e32152 (diff) | |
download | mongo-3389eef4cffcb07845a8d073dd825b6d40df6d9b.tar.gz |
SERVER-28690 raise currentOp limit to 1000 bytes
-rw-r--r-- | jstests/noPassthrough/currentop_query.js | 49 | ||||
-rw-r--r-- | src/mongo/db/curop.cpp | 2 |
2 files changed, 25 insertions, 26 deletions
diff --git a/jstests/noPassthrough/currentop_query.js b/jstests/noPassthrough/currentop_query.js index 5de8ce8abaf..92c27d26d56 100644 --- a/jstests/noPassthrough/currentop_query.js +++ b/jstests/noPassthrough/currentop_query.js @@ -349,7 +349,7 @@ } // - // Confirm 512 byte size limit for currentOp query field. + // Confirm ~1000 byte size limit for currentOp query field. // coll.drop(); assert.writeOK(coll.insert({a: 1})); @@ -358,20 +358,18 @@ // values inside it are truncated at 150 characters. To test "total length" truncation we // need to pass multiple values, each smaller than 150 bytes. TestData.queryFilter = { - "1": "1".repeat(100), - "2": "2".repeat(100), - "3": "3".repeat(100), - "4": "4".repeat(100), - "5": "5".repeat(100), - "6": "6".repeat(100), + "1": "1".repeat(149), + "2": "2".repeat(149), + "3": "3".repeat(149), + "4": "4".repeat(149), + "5": "5".repeat(149), + "6": "6".repeat(149), + "7": "7".repeat(149), }; - var truncatedQueryString = "{ find: \"currentop_query\", filter: { " + - "1: \"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", " + - "2: \"2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222\", " + - "3: \"3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333\", " + - "4: \"4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444\", " + - "5: \"5555555555555555555555555555555555555555..."; + var truncatedQueryString = "^\\{ find: \"currentop_query\", filter: \\{ " + + "1: \"1{149}\", 2: \"2{149}\", 3: \"3{149}\", 4: \"4{149}\", 5: \"5{149}\", " + + "6: \"6{149}\", 7: \"7+\\.\\.\\."; confirmCurrentOpContents({ test: function() { @@ -381,8 +379,10 @@ 0); }, planSummary: "COLLSCAN", - currentOpFilter: - {"query.$truncated": truncatedQueryString, "query.comment": "currentop_query"} + currentOpFilter: { + "query.$truncated": {$regex: truncatedQueryString}, + "query.comment": "currentop_query" + } }); // Verify that an originatingCommand truncated by currentOp appears as { $truncated: @@ -399,7 +399,7 @@ filter = { "query.getMore": TestData.commandResult.cursor.id, - "originatingCommand.$truncated": truncatedQueryString, + "originatingCommand.$truncated": {$regex: truncatedQueryString}, "originatingCommand.comment": "currentop_query" }; @@ -416,13 +416,10 @@ // Verify that an aggregation truncated by currentOp appears as { $truncated: <string>, // comment: <string> } when a comment parameter is present. - truncatedQueryString = "{ aggregate: \"currentop_query\", pipeline: [ { $match: { 1: " + - "\"111111111111111111111111111111111111111111111111111111111111111111111111111111" + - "1111111111111111111111\", 2: \"2222222222222222222222222222222222222222222222222" + - "222222222222222222222222222222222222222222222222222\", 3: \"33333333333333333333" + - "33333333333333333333333333333333333333333333333333333333333333333333333333333333" + - "\", 4: \"44444444444444444444444444444444444444444444444444444444444444444444444" + - "44444444444444444444444444444\", 5: \"555555555555555555555..."; + truncatedQueryString = + "^\\{ aggregate: \"currentop_query\", pipeline: \\[ \\{ \\$match: \\{ " + + "1: \"1{149}\", 2: \"2{149}\", 3: \"3{149}\", 4: \"4{149}\", 5: \"5{149}\", " + + "6: \"6{149}\", 7: \"7+\\.\\.\\."; confirmCurrentOpContents({ test: function() { @@ -433,8 +430,10 @@ 0); }, planSummary: "COLLSCAN", - currentOpFilter: - {"query.$truncated": truncatedQueryString, "query.comment": "currentop_query"} + currentOpFilter: { + "query.$truncated": {$regex: truncatedQueryString}, + "query.comment": "currentop_query" + } }); delete TestData.queryFilter; diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index f4c028879c3..8a8f035d351 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -359,7 +359,7 @@ void CurOp::reportState(BSONObjBuilder* builder) { // When currentOp is run, it returns a single response object containing all current // operations. This request will fail if the response exceeds the 16MB document limit. We limit // query object size here to reduce the risk of exceeding. - const size_t maxQuerySize = 512; + const size_t maxQuerySize = 1000; if (_networkOp == dbInsert) { appendAsObjOrString("insert", _query, maxQuerySize, builder); |