[SERVER-52973] CursorID (long long) printed via LOGV2 can print corrupted value (lower-order bytes altered). Created: 20/Nov/20  Updated: 12/Feb/21  Resolved: 12/Feb/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Mindaugas Malinauskas
Resolution: Cannot Reproduce Votes: 0
Labels: greenerbuild, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
Operating System: ALL
Sprint: Query 2020-11-30
Participants:
Linked BF Score: 12

 Description   

Came from investigation on BF-18408. It seems like a platform/hardware specific bug. Not able to reproduce in my local machine but I was able to reproduce on Amazon EC2 instance.

E.g., cursor id 8388079694692667449, when printing via LOGV2 (or via javascript layer print()) it displays some corrupted value, like, 8388079694692667000.

P.S: Based on my analysis, the real data isn't corrupted, just the value that gets printed are corrupted (both in c++ and javascript layer).



 Comments   
Comment by Mindaugas Malinauskas [ 12/Feb/21 ]

One part is reproducible, but the problem is in an Evergreen component. A ticket has been filed.

Comment by Mindaugas Malinauskas [ 12/Feb/21 ]

LOGV2 part - no problem with the Server, but there is a defect in Lobster. A ticket has been filed EVG-14065.

print() part is not reproducible. Executed the following sequences of scripts in mongo shell:

> let result = db.c.runCommand({find: "c", batchSize: 2});
> print(result.cursor.id)
NumberLong("5796379875659599147")
> let result3 = db.c.runCommand({getMore: result.cursor.id, collection: "c",  batchSize: 1})
> print(result3.cursor.id)
NumberLong("5796379875659599147")

cursor.id type is NumberLong and it gets printed correctly:

> let n = NumberLong("8388079694692667449")
> print(n)
NumberLong("8388079694692667449")

However, if one executed in the shell

> let n = 8388079694692667449;
> print(n)
8388079694692667000

then the value would get corrupted in the same way as it happens in the Lobster (the precision can not be preserved ).

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