Merge branch 'cassandra-4.1' into trunk

This commit is contained in:
Stefan Miklosovic 2022-08-15 10:13:12 +02:00
commit 77e4eb4770
2 changed files with 14 additions and 7 deletions

View File

@ -81,6 +81,7 @@ Merged from 3.11:
* Document usage of closed token intervals in manual compaction (CASSANDRA-17575)
* Creating of a keyspace on insufficient number of replicas should filter out gosspping-only members (CASSANDRA-17759)
Merged from 3.0:
* Improve libjemalloc resolution in bin/cassandra (CASSANDRA-15767)
* Fix restarting of services on gossipping-only member (CASSANDRA-17752)

View File

@ -132,21 +132,27 @@ find_library()
pattern=$1
path=$(echo ${2} | tr ":" " ")
find $path -regex "$pattern" -print 2>/dev/null | head -n 1
find $path -regex "$pattern" -print 2>/dev/null | sort -ru | head -n 1
}
case "`uname -s`" in
Linux)
if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
dirs="/lib64 /lib /usr/lib64 /usr/lib "
which ldconfig > /dev/null 2>&1
if [ $? = 0 ] ; then
# e.g. for CentOS
dirs="/lib64 /lib /usr/lib64 /usr/lib `ldconfig -v 2>/dev/null | grep -v '^\s' | sed 's/^\([^:]*\):.*$/\1/'`"
else
# e.g. for Debian, OpenSUSE
dirs="/lib64 /lib /usr/lib64 /usr/lib `cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf | grep '^/'`"
dirs="$dirs `ldconfig -v 2>/dev/null | grep -v '^\s' | sed 's/^\([^:]*\):.*$/\1/'`"
fi
if [ -f /etc/ld.so.conf ]; then
dirs="$dirs `cat /etc/ld.so.conf | grep '^/'`"
fi
additional_configs=$(ls /etc/ld.so.conf.d/*.conf 2>&1)
if [ $? = 0 ]; then
for conf in $additional_configs; do
dirs="$dirs `cat $conf | grep '^/'`"
done
fi
dirs=`echo $dirs | tr " " ":"`
CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so\(\.1\)*' $dirs)
CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so.*' $dirs)
fi
if [ ! -z $CASSANDRA_LIBJEMALLOC ] ; then
export JVM_OPTS="$JVM_OPTS -Dcassandra.libjemalloc=$CASSANDRA_LIBJEMALLOC"