[SERVER-21297] jstests/slow2/conc_update.js fails on s390x on Redhat Created: 04/Nov/15  Updated: 14/Apr/16  Resolved: 02/Mar/16

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

Type: Bug Priority: Major - P3
Reporter: William Zhang Assignee: Mira Carey
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File conc_update.js.log    
Issue Links:
Duplicate
duplicates SERVER-22801 Fix callers of serialize/deserialize ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 10 (02/19/16), Platforms 11 (03/11/16)
Participants:

 Description   

The JavaScript test jstests/slow2/conc_update.js fails on s390x on RHEL7.

d20000| 2015-11-04T14:14:54.855-0500 I INDEX [conn1] build index on: concurrency.conc properties: { v: 1, key:

{ x: 1.0 }

, name: "x_1", ns: "concurrency.conc" }
d20000| 2015-11-04T14:14:54.855-0500 I INDEX [conn1] building index using bulk method
d20000| 2015-11-04T14:14:57.000-0500 I - [conn1] Index Build: 1729800/3145728 54%
d20000| 2015-11-04T14:15:01.106-0500 I - [conn1] Index Build: 2688700/3145728 85%
d20000| 2015-11-04T14:15:02.084-0500 I - [conn1] Invariant failure raw == RecordId::min().repr() src/mongo/db/storage/key_string.cpp 352
d20000| 2015-11-04T14:15:02.084-0500 I - [conn1]

The entire log is in the attachment.



 Comments   
Comment by Bryan Chan [ 12/Nov/15 ]

redbeard0531, to avoid breaking the semantics of the fields written to the buffer, I believe _repr should be stored with buf.appendNum() instead of buf.appendStruct(). What do you think?

Comment by William Zhang [ 12/Nov/15 ]

The issue is in https://github.com/mongodb/mongo/blob/master/src/mongo/db/record_id.h#L111

RecordId._repr, a big endian integer on s390x, is written to buffer while treated as an array of char.

This issue have been fixed. Thank you so much, Mathias!

Comment by Mathias Stearn [ 05/Nov/15 ]

That means that the RecordId is invalid before it reaches SortKey. If I had to guess, I'd say the issue is likely to be in the BufReader used by the external sorter used for bulk index builds. You can confirm that quickly by changing these lines to use memcpy rather than casts: https://github.com/mongodb/mongo/blob/master/src/mongo/util/bufreader.h#L64 https://github.com/mongodb/mongo/blob/master/src/mongo/util/bufreader.h#L83. We'd probably want to do something cleaner for commit, but this will at least confirm whether this is the problem if it it lies somewhere else.

Comment by William Zhang [ 05/Nov/15 ]

Hi Mathias, here is the new output:

d20000| 2015-11-05T15:35:39.964-0500 I INDEX [conn1] build index on: concurrency.conc properties: { v: 1, key:

{ x: 1.0 }

, name: "x_1", ns: "concurrency.conc" }
d20000| 2015-11-05T15:35:39.964-0500 I INDEX [conn1] building index using bulk method
d20000| 2015-11-05T15:35:42.008-0500 I - [conn1] Index Build: 302200/3145728 9%
d20000| 2015-11-05T15:35:45.017-0500 I - [conn1] Index Build: 638700/3145728 20%
d20000| 2015-11-05T15:35:48.014-0500 I - [conn1] Index Build: 972600/3145728 30%
d20000| 2015-11-05T15:35:51.000-0500 I - [conn1] Index Build: 1354400/3145728 43%
d20000| 2015-11-05T15:35:54.008-0500 I - [conn1] Index Build: 1699300/3145728 54%
d20000| 2015-11-05T15:35:57.001-0500 I - [conn1] Index Build: 2141600/3145728 68%
d20000| 2015-11-05T15:36:02.486-0500 I - [conn1] Index Build: 2688700/3145728 85%
d20000| 2015-11-05T15:36:04.196-0500 I STORAGE [conn1] raw: -9223372036854775808 null: 0 min: -9223372036854775808 max: 9223372036854775807
d20000| 2015-11-05T15:36:04.196-0500 I STORAGE [conn1] raw: -9151314442816847872 null: 0 min: -9223372036854775808 max: 9223372036854775807
d20000| 2015-11-05T15:36:04.196-0500 I - [conn1] Invariant failure raw == RecordId::min().repr() src/mongo/db/storage/key_string.cpp 353
d20000| 2015-11-05T15:36:04.196-0500 I - [conn1]
d20000|
d20000| ***aborting after invariant() failure

Comment by Mathias Stearn [ 05/Nov/15 ]

Could you add the following line at the top of this if block and rerun: https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/key_string.cpp#L349

log() << "raw: " << raw << " null: " << RecordId().repr() << " min: " RecordId::min().repr() << " max: " << RecordId::max().repr();

Generated at Thu Feb 08 03:56:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.