From 347c3d2261d0295f55f80c1f2bc8c575eb160529 Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Thu, 2 Jan 2020 19:29:49 -0500 Subject: [PATCH] MCOL-3702: postConfig replication error Todd & Andrew ID'd the problem as being that the libjemalloc.so -> (real lib) link doesn't always exist for whatever reason. I hacked our run script to try the 3 possibilities mentioned in the ticket in this order 1) libjemalloc.so 2) libjemalloc.so.1 3) libjemalloc.so.2 Failing that, it will fall back to an empty LD_PRELOAD, so libc would be used for the allocator. Fixes the immediate problem. The lib_bin and server_id vars mentioned in the ticket are untouched by this commit. --- oam/install_scripts/columnstore_run.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/oam/install_scripts/columnstore_run.sh b/oam/install_scripts/columnstore_run.sh index e77464543..d2cc4b384 100755 --- a/oam/install_scripts/columnstore_run.sh +++ b/oam/install_scripts/columnstore_run.sh @@ -48,8 +48,27 @@ if [ $vflg -gt 0 ]; then echo "starting $exename $args with sleep=$sopt and tries=$topt" fi +which_jemalloc() { + LD_PRELOAD="$1" /bin/true >& /tmp/jemalloc_test + grep -i error /tmp/jemalloc_test >& /dev/null + if [ $? -ne 0 ] ; then + JEMALLOC="$1" + else + unset JEMALLOC + fi + rm /tmp/jemalloc_test +} + +which_jemalloc libjemalloc.so +if [ -z "$JEMALLOC" ] ; then + which_jemalloc libjemalloc.so.1 +fi +if [ -z "$JEMALLOC" ] ; then + which_jemalloc libjemalloc.so.2 +fi + while [ $keep_going -ne 0 ]; do - LD_PRELOAD=libjemalloc.so $exename $args + LD_PRELOAD=$JEMALLOC $exename $args if [ -e ${lopt}/StopColumnstore ]; then exit 0 fi