Skip to content

Commit

Permalink
Merge branch 'cassandra-4.0' into cassandra-4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
smiklosovic committed Aug 15, 2022
2 parents e7bdee5 + 5023a81 commit 71cef76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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)


Expand Down
20 changes: 13 additions & 7 deletions bin/cassandra
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 71cef76

Please sign in to comment.