Backup data compression is a CPU bound operation that will not yield to
other greenthreads, so given enough simultaneous backup operations they
will lead to other threads' starvation.
This is really problematic for DB connections, since starvation will
lead to connections getting dropped with errors such as "Lost connection
to MySQL server during query".
Detailed information on why these connections get dropped can be found
in comment "[31 Aug 2007 9:21] Magnus Blåudd" on this MySQL bug [1].
These DB issues may result in backups unnecessary ending in an "error"
state.
This patch fixes this by moving the compression to a native thread so
the cooperative multitasking in Cinder Backup can continue switching
threads.
Reviewed: https:/ /review. openstack. org/518311 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=41754fd57f2 7bba646d1d6e263 88c7f5f4c2dc4e
Committed: https:/
Submitter: Zuul
Branch: driverfixes/newton
commit 41754fd57f27bba 646d1d6e26388c7 f5f4c2dc4e
Author: Gorka Eguileor <email address hidden>
Date: Wed Sep 13 19:46:17 2017 +0200
Run backup compression on native thread
Backup data compression is a CPU bound operation that will not yield to
other greenthreads, so given enough simultaneous backup operations they
will lead to other threads' starvation.
This is really problematic for DB connections, since starvation will
lead to connections getting dropped with errors such as "Lost connection
to MySQL server during query".
Detailed information on why these connections get dropped can be found
in comment "[31 Aug 2007 9:21] Magnus Blåudd" on this MySQL bug [1].
These DB issues may result in backups unnecessary ending in an "error"
state.
This patch fixes this by moving the compression to a native thread so
the cooperative multitasking in Cinder Backup can continue switching
threads.
[1] https:/ /bugs.mysql. com/bug. php?id= 28359
Closes-Bug: #1692775 68072a39816fa9f a224c2eb6a5 395adfe0575b0db e353e18bbe) a1acfe36b5ea8a6 c5bae6139f) 501e3a5fb14521f 05e38a2ae9)
Closes-Bug: #1719580
Change-Id: I1946dc0ad9cb7a
(cherry picked from commit af0f00bc52f79d9
(cherry picked from commit 439f90da8e4c1cf
(cherry picked from commit b241f93267646a6