RECOVER: When we pull databases during recovery, we used to reallocate the databuffer...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 25 May 2012 02:27:59 +0000 (12:27 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 19 Feb 2013 06:30:00 +0000 (17:30 +1100)
commit9d8338fc14cfa5f4d8236eccb90ffdd4cdc11343
treeecd379d9c919013ae797a0353ad313c65abb43da
parentc6e1b84595039edb5c49a5851b440710dc0e2ac1
RECOVER: When we pull databases during recovery, we used to reallocate the databuffer for each entry added. This would normally not be an issue, but for cases where memory is fragmented, this could start to cost significant cpu if we need to reallocate and move to a different region.

Change this to instead preallocate , by default, 10MByte chunks to the data buffer.
This significantly reduces the number of potential reallocate and move  operations that may be required.

Create a tunable to override/change how much preallocation should be used.

Conflicts:
include/ctdb_private.h
server/ctdb_tunables.c

Cherry-pick-from: 1f262deaad0818f159f9c68330f7fec121679023

Also, make sure the preallocation size is 10MB and not 100MB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
include/ctdb_private.h
server/ctdb_recover.c
server/ctdb_recoverd.c
server/ctdb_tunables.c