[SERVER-14835] fix fassert 16143 on PPC64 LE systems in LogFile::synchronousAppend() Created: 08/Aug/14  Updated: 18/Nov/14  Resolved: 25/Sep/14

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

Type: Bug Priority: Trivial - P5
Reporter: Corentin Baron Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-13452 Add PPC64 as a supported platform Closed
Participants:

 Description   

Linux on PPC64 use 64kB page size, making this crash whereas it works well.

https://github.com/mongodb/mongo/pull/735



 Comments   
Comment by Githook User [ 25/Sep/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14835 removed PPC64-specific value for AlignedBuilder::Alignment. reject zero block size from ioctl()
Branch: master
https://github.com/mongodb/mongo/commit/68881762f612542372f8f55d61db0bf7856da762

Comment by Githook User [ 25/Sep/14 ]

Author:

{u'username': u'corentinbaron', u'name': u'Corentin Baron', u'email': u'corentin.baron@ext.bull.net'}

Message: SERVER-14835 Fixed alignment check in log file for PPC64

Closes #769

Signed-off-by: Benety Goh <benety@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/0adbbde35e8ca1696145f21bde5c311b3da6d4e5

Comment by Corentin Baron [ 10/Sep/14 ]

Updated

Comment by Benety Goh [ 10/Sep/14 ]

Hi ctrl_alt_suppr, the patch did not compile under Windows. I've provided a more detailed feedback in #769.

Comment by Benety Goh [ 10/Sep/14 ]

ctrl_alt_suppr, thank you for rebasing on master. I'll be running #769 through our CI system before taking a closer look at the code.

Comment by Corentin Baron [ 10/Sep/14 ]

Updated and put on master:

https://github.com/mongodb/mongo/pull/769

Comment by Benety Goh [ 05/Sep/14 ]

Thanks ctrl_alt_suppr I've added some initial feedback to the pull request.

Comment by Corentin Baron [ 05/Sep/14 ]

Updated:
https://github.com/mongodb/mongo/pull/766

Comment by Corentin Baron [ 28/Aug/14 ]

Hi,

Sorry for the late response, unfortunately I had different requests on other fronts.

I tried this method, and it requires to also have AlignedBuilder::Alignment changed since on our systems ioctl(_fd, BLKBSZGET) actually gives 65536. The issue being this value is a static const and therefore can't be set at runtime. We'd need to either make it a non const, either pass the value to gcc as a define.

Corentin.

Comment by Matt Kangas [ 13/Aug/14 ]

To clarify Andy's point: mongo::LogFile uses O_DIRECT if available (Linux 2.4.10 and up)

O_DIRECT requirements:

  • Linux 2.6
    • Alignment, length, and offset must be multiples of the physical_block_size of the device. (Typically 512 bytes)
  • Linux 2.4
    • Alignment, length, and offset must be multiples of the logical_block_size of the underlying file system. (Typically 4096 bytes)

So we need to keep the fassert, but we shouldn't test for multiples of g_minOSPageSizeBytes (from mmap.h). Instead, we should call ioctl(_fd, BLKBSZGET) to obtain size_t logical_block_size immediately after a successful open(). Then test for multiples of this value when _direct == true.

We also need to confirm that BLKBSZGET always works when O_DIRECT is defined. (= Confirm BLKBSZGET is defined in Linux 2.4.10 and up)

See:

Comment by Andy Schwerin [ 08/Aug/14 ]

It used to be the case that direct-io writes on Linux had to start at a block-aligned address and consist of whole-block-sized writes. Because we did not have access to the block size on the journal file system at the time, we simply used the page size as a proxy. Removing this assertion does remove that safeguard, if only on PPC systems.

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