READ_CONFIG_REQ signal provides all
kernel blocks an opportunity to read the configuration data,
which is stored in a global object accessible to all blocks. All
memory allocation in the data nodes takes place during this
Connections between the kernel blocks and the
NDB file system are also set up during
Phase 0. This is necessary to enable the blocks to communicate
easily which parts of a table structure are to be written to
NDB performs memory allocations in two
different ways. The first of these is by using the
allocRecord() method (defined in
This is the traditional method whereby records are accessed
ptrCheckGuard macros (defined in
other method is to allocate memory using the
setSize() method defined with the help of the
template found in
These methods sometimes also initialize the memory, ensuring that both memory allocation and initialization are done with watchdog protection.
Many blocks also perform block-specific initialization, which often entails building linked lists or doubly-linked lists (and in some cases hash tables).
Many of the sizes used in allocation are calculated in the
Configuration::calcSizeAlt() method, found in
Some preparations for more intelligent pooling of memory
resources have been made.
DataMemory and disk
records already belong to this global memory pool.