Modify SST code to use fork()/exec() to allow cleanup on fatal signals
Bug #1382797 reported by
Alexey Kopytov
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
Medium
|
Alexey Kopytov | |||
5.6 |
Fix Released
|
Medium
|
Alexey Kopytov |
Bug Description
The SST code in wsrep_util.cc uses posix_spawnp() to spawn a shell process executing the actual SST script. I don't know if there's any viable reason to use posix_spawnp() instead of fork()/exec(), but one problem we can solve by doing it with fork()/exec() is cleaning up children (i.e. processes spawned by the SST script) when mysqld crashes or is killed with a non-interceptable signal such as SIGKILL.
See comment #4 in https:/
Related branches
lp:~akopytov/percona-xtradb-cluster/bug1382797-5.5
- Alexey Kopytov (community): Needs Fixing
- Raghavendra D Prabhu: Pending requested
-
Diff: 265 lines (+110/-100)2 files modifiedsql/wsrep_utils.cc (+96/-100)
storage/innobase/os/os0proc.c (+14/-0)
lp:~akopytov/percona-xtradb-cluster/bug1382797-5.6
- Raghavendra D Prabhu (community): Needs Fixing
- Alexey Kopytov (community): Needs Fixing
-
Diff: 266 lines (+111/-100)2 files modifiedsql/wsrep_utils.cc (+97/-100)
storage/innobase/os/os0proc.cc (+14/-0)
description: | updated |
description: | updated |
Changed in percona-xtradb-cluster: | |
status: | New → Confirmed |
To post a comment you must log in.
Alexey, the reason posix_spawn() is used to fork SST script is that at that time it seemed to be the only way to spawn a process without creating a full copy of the parent memory image. On dedicated servers where mysqld used more than 50% of RAM and with no swap space, forking SST script used to fail due to memory constraints.
I suppose that the problem with cleaning children arises from the not-entirely- correct usage of posix_spawn() in SST code. Perhaps passing proper flags would have solved it.