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)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 25 May 2012 02:27:59 +0000 (12:27 +1000)
commitea073ef2f73343247e653c7c39f2e0f5e34a0c39
treed4c38d7a74a8cfc64540285ca0d115d0b02ef4f6
parentb8260448c192c3866bffb99b475a4b3de57f38b3
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.
include/ctdb_private.h
server/ctdb_recover.c
server/ctdb_recoverd.c
server/ctdb_tunables.c