[SERVER-43151] Error in aggregation assertion at value.cpp:1368 Created: 04/Sep/19  Updated: 29/Oct/23  Resolved: 28/Oct/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.12
Fix Version/s: 3.6.15, 4.3.1, 3.4.24, 4.2.2, 4.0.14

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File stacktrace.txt    
Issue Links:
Backports
Duplicate
is duplicated by SERVER-44945 aggregate failed at assertion src\\mo... Closed
Related
is related to SERVER-44497 Aggregation: {"codeName" : "UnknownEr... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0, v3.6, v3.4
Sprint: Query 2019-11-04
Participants:

 Description   

When running an aggregation with $group and $first and $last for "$$ROOT" I get this error:

2019-09-04T13:46:11.118-0400 E QUERY    [js] Error: command failed: {
	"operationTime" : Timestamp(1567619155, 1218),
	"ok" : 0,
	"errmsg" : "assertion src/mongo/db/pipeline/value.cpp:1368",
	"code" : 8,
	"codeName" : "UnknownError",
	"$clusterTime" : {
		"clusterTime" : Timestamp(1567619155, 1218),
		"signature" : {
			"hash" : BinData(0,"Ra+UKIAYLDFuDOJc2Q6v16BRwsI="),
			"keyId" : NumberLong("6694721349983666177")
		}
	}
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:536:17
assert.commandWorked@src/mongo/shell/assert.js:620:16
DB.prototype._runAggregate@src/mongo/shell/db.js:260:9
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1062:12
@(shell):1:1



 Comments   
Comment by Asya Kamsky [ 30/Apr/20 ]

Root cause of this was in some cases spilling to disk and having the file on disk grow to some size larger than 4GBs.

Comment by Githook User [ 29/Oct/19 ]

Author:

{'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com', 'name': 'Bernard Gorman'}

Message: SERVER-43151 DSGroup should record current spill file offset as std::streampos

(cherry picked from commit e20b65008f4738d73d338ed1af464ec8a1749742)
Branch: v4.2
https://github.com/mongodb/mongo/commit/c49dfbfae5589f189ec4b8b8469cf9b255036671

Comment by Githook User [ 29/Oct/19 ]

Author:

{'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com', 'name': 'Bernard Gorman'}

Message: SERVER-43151 DSGroup should record current spill file offset as std::streampos

(cherry picked from commit e20b65008f4738d73d338ed1af464ec8a1749742)
Branch: v4.0
https://github.com/mongodb/mongo/commit/198cdb8c0774682e947cdf46caa6ea13bde77b01

Comment by Githook User [ 29/Oct/19 ]

Author:

{'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com', 'name': 'Bernard Gorman'}

Message: SERVER-43151 DSGroup should record current spill file offset as std::streampos

(cherry picked from commit e20b65008f4738d73d338ed1af464ec8a1749742)
Branch: v3.4
https://github.com/mongodb/mongo/commit/ec4db6d457448130a55ad41d4d42c1449bbeadf1

Comment by Githook User [ 29/Oct/19 ]

Author:

{'name': 'Bernard Gorman', 'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com'}

Message: SERVER-43151 DSGroup should record current spill file offset as std::streampos

(cherry picked from commit e20b65008f4738d73d338ed1af464ec8a1749742)
Branch: v3.6
https://github.com/mongodb/mongo/commit/db36f1024d6623a2bce4570118c1ea4b9968f7dc

Comment by Githook User [ 28/Oct/19 ]

Author:

{'name': 'Bernard Gorman', 'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com'}

Message: SERVER-43151 DSGroup should record current spill file offset as std::streampos
Branch: master
https://github.com/mongodb/mongo/commit/e20b65008f4738d73d338ed1af464ec8a1749742

Comment by Eric Milkie [ 18/Oct/19 ]

The symptoms described in this ticket does not suggest data corruption on disk, but does suggest BSON corruption in memory with the use of $$ROOT.

Comment by Brian Lane [ 18/Oct/19 ]

Hey vikas.ramnani and eric.sedor - Since its happening in both 4.0 and 4.2, I don't think this is related to the different versions of snappy. I am going to pass this over to execution, who can direct it to another team as needed.

-Brian

Generated at Thu Feb 08 05:02:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.