Bug #78524 Wakeup from NDBFS doesn't work in Non-(Linux+x86) environments
Submitted: 23 Sep 2015 6:05 Modified: 5 Aug 2016 12:55
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.4.7 OS:Any
Assigned to: CPU Architecture:Any

[23 Sep 2015 6:05] Mikael Ronström
Description:
When NDBFS is done with a file operations it wakes the main thread up.
In Linux using x86 this works, but the implementation using mutexes
doesn't work. It checks the condition to see if it should really wake
up. But the condition check doesn't take NDBFS into account, so no
wake up will occur. Also we don't scan the NDBFS before calling
run_job_buffers so we won't discover that we have waiting NDBFS
data until we come back to yield and run the check for empty
before going to sleep. It would be a lot more efficient to check
for data from NDBFS immediately after waking up.

How to repeat:
Run test ndb_basic on e.g. a Mac OS X. The test takes 37 seconds
without fix. It takes 15 seconds with fix.

Suggested fix:
Remove while loop in yield and use if (same as in x86+Linux).
It means some spurious wakeups will run through the scheduler,
but this is ok, won't be an issue.
[5 Aug 2016 9:01] Mauritz Sundell
Posted by developer:
 
Pushed to 7.4.9
[5 Aug 2016 12:55] Jon Stephens
Documented fix in the NDB 7.4.9 changelog as follows:

    When NDBFS completed file operations the method it used for waking the
    main thread up worked effectively on Linux/x86 platforms, but not on
    some others, including Mac OS X, which could lead to unnecessary
    slowdowns on those platforms.

Closed.