Bug #74782 ndb not functional on POWER
Submitted: 11 Nov 2014 9:35 Modified: 17 Nov 2014 9:53
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.3.7 OS:Linux
Assigned to: CPU Architecture:Any
Tags: ndbmtd, POWER8, PowerPC

[11 Nov 2014 9:35] Stewart Smith
Description:
ndbmtd uses memory barriers and has got implementations for x86/x86-64 and SPARC but not POWER, thus MySQL Cluster fails to compile on POWER

How to repeat:
cmake ../ -DWITH_NDB_JAVA=0
make -j160 # yes, i'm showing off in my number of CPU cores.

you will get compiler errors due to missing memory barrier code for POWER.

Suggested fix:
Apply my patch!
[11 Nov 2014 9:36] Stewart Smith
Basic memory barriers for POWER

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: ndb-power-barriers.patch (text/x-patch), 763 bytes.

[11 Nov 2014 9:38] Stewart Smith
with this patch, I can successfully build MySQL Cluster 7.3.7 and get some tests passing and flexAsync results.
[11 Nov 2014 9:46] MySQL Verification Team
Hello Stewart,

Thank you for the report and contribution.

Thanks,
Umesh
[12 Nov 2014 4:03] Stewart Smith
After a bit of review and thought, this is a better patch, using lwsync rather than sync.

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: ndb-power-barriers-lwsync.patch (text/x-patch), 769 bytes.

[12 Nov 2014 4:06] Stewart Smith
Implement xcng() for POWER for NDB

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: ndb-xcng.patch (text/x-patch), 1020 bytes.

[12 Nov 2014 4:09] Stewart Smith
My patch that uses lwsync and my patch implementing xcng are what I'm currently testing with. These seem to be rather solid.

The xcng implementation gives us a moderate performance improvement:
SMT4 - base
flexAsynch -ndbrecord -temp -con 4 -t 32 -p 512 -r 2 -a 2
insert average: 2094069/s min: 2094069/s max: 2094069/s stddev: 0%
update average: 2489969/s min: 2489969/s max: 2489969/s stddev: 0%
delete average: 1806793/s min: 1806793/s max: 1806793/s stddev: 0%
read   average: 2744160/s min: 2686782/s max: 2796858/s stddev: 1%

SMT4 - with xcng
insert average: 2115702/s min: 2115702/s max: 2115702/s stddev: 0%
update average: 2600634/s min: 2600634/s max: 2600634/s stddev: 0%
delete average: 2634930/s min: 2634930/s max: 2634930/s stddev: 0%
read   average: 2790971/s min: 2759178/s max: 2855350/s stddev: 1%
[17 Nov 2014 9:53] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

Documented fix as follows in the NDB 7.3.8 changelog:

    MySQL Cluster programs such as ndbmtd did not compile on POWER
    platforms.

Closed.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html