Merge lp:~akopytov/percona-xtradb-cluster/bug1382797-5.5 into lp:percona-xtradb-cluster/5.5
Status: | Merged |
---|---|
Approved by: | Raghavendra D Prabhu |
Approved revision: | no longer in the source branch. |
Merged at revision: | 835 |
Proposed branch: | lp:~akopytov/percona-xtradb-cluster/bug1382797-5.5 |
Merge into: | lp:percona-xtradb-cluster/5.5 |
Diff against target: |
265 lines (+110/-100) 2 files modified
sql/wsrep_utils.cc (+96/-100) storage/innobase/os/os0proc.c (+14/-0) |
To merge this branch: | bzr merge lp:~akopytov/percona-xtradb-cluster/bug1382797-5.5 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Fixing | ||
Raghavendra D Prabhu | Pending | ||
Review via email: mp+243696@code.launchpad.net |
Description of the change
Bug #1382797: Modify SST code to use fork()/exec() to allow cleanup on
fatal signals
Bug #1399175: Incorrect POSIX_SPAWN_
Modified wsp::process() to use fork()/exec() instead of posix_spawn() to
have more control on the child process. More specifically:
- the child process now calls prctl() with appropriate arguments (if
available) before calling exec() so that the SIGTERM signal is
received by it in case the parent process (i.e. mysqld) is terminated
either gracefully or ungracefully.
- the child process also call setsid() to create a new session and a
process group. This is to simplify killing all spawned processes at
once for child processes. Instead of keeping track of all processes
started by an SST script and sending termination signals to the
individually, an SST script can simply kill the entire process group.
Additionally, an optimization to speed up fork() has been implemented to
reduce page table copying overhead as compared to vfork() /
posix_spawn(). Since the InnoDB buffer pool is the major part of mysqld
RSS in most installations, use madvise(..., MADV_DONTFORK) to exclude
buffer pool from memory available to the child on fork().
This revision also fixes bug #1399175 as a side effect, since all code
related to the posix_spawn*() family of functions is replaced.
Forgot to add signal signal-related code. Will repush.