As of MCS 5.6.5 there cases when initial EM load(load_brm) causes boost::inter_process::bad_alloc exception in ExtentMap::loadVersion4() when populating EM index.
There is an extent map example attached to this issue that can be used to reproduce the issue. At the certain record EM index managed shmem segment has 1.2 MB but this pool is fragmented so that 1.2 KB can't be allocated in a continues chunk. unordered_map rehashing throws bad_alloc in this case.
Steps to reproduce:
- stop MCS
- save the problematic EM as /var/lib/columnstore/data1/systemFiles/dbrm/BRM_saves_em (the EM image has an impossible number of records so the original file should be edited with a hexeditor. The proper number of EMEntries can be calculated from the size of the image.
- run load_brm /var/lib/columnstore/data1/systemFiles/dbrm/BRM_saves
load_brm throws the above mentioned exception.
Moreover I think this can happen in a real_time also setting a cluster to read-only.