Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ac9acf3
Migrate to the new Datastax internal artifactory
mukesh-ctds Feb 6, 2025
7514e4b
Enable Github CI for Datastax fork
mukesh-ctds Feb 6, 2025
daaa7af
Correct RackawareEnsemblePlacementPolicyImpl defaultRack when the boo…
horizonzy Jul 8, 2024
8a58b74
Fix the completionObjects leak problem. (#4285)
horizonzy Jul 9, 2024
d0e7ff0
fix: install netcat-openbsd instead of netcat in test image build (#4…
Jul 29, 2024
c94b5e3
Change the new ensemble log to info level (#4566)
zymap Mar 19, 2025
978d496
Fix SST files not being cleaned up in the locations folder (#4555)
danpi Apr 1, 2025
143fc78
fix: fix resource leaks in 3 classes (#4449)
dk2k Jul 6, 2024
068db0c
Enable ZooKeeper client to establish connection in read-only mode (#4…
massakam Jul 10, 2024
f3cca70
Allocator support exitOnOutOfMemory config. (#3984)
horizonzy Jul 15, 2024
042423f
[fix][ci] Fix OWASP Dependency Check download by using NVD API key (#…
Jul 29, 2024
af0642a
fix[rocksdb]: fix error rocksdb default config for CFOptions (#4466)
AuroraTwinkle Jul 20, 2024
b9c2671
Set default format_version to 5 for RocksDB databases (#4480)
lhotari Aug 16, 2024
3642f05
when failed to choose a bookie, print out the list of ensemble. (#4482)
liudezhi2098 Aug 20, 2024
1fe52a9
Upgrade to Netty 4.1.113.Final and netty-tcnative 2.0.66.Final (#4502)
lhotari Sep 12, 2024
b19ddb3
[fix] Fix data lost after when writing ledger and deleting legder exe…
poorbarcode Sep 13, 2024
2ebc925
Upgrade protobuf to 3.25.5 to address CVE-2024-7254 (#4508)
lhotari Sep 25, 2024
b551eb2
Optimize reorderReadSequence to check WriteSet instead of entire Ense…
ange-k Nov 13, 2024
2cefaff
Upgrade Zookeeper to 3.9.3 to address CVE-2024-51504 (#4523)
lhotari Nov 13, 2024
12a1f14
Upgrade to Netty 4.1.115.Final to address CVE-2024-47535 (#4524)
lhotari Nov 19, 2024
bb00a83
chore: remove docker tuning from tune-runner-vm action (#4536)
equanz Dec 20, 2024
b18b79d
Bump vertx.version from 4.5.7 to 4.5.11 to address CVE-2024-8391 (#4545)
hezhangjian Jan 10, 2025
eeb2697
Add documentation to bk_server.conf about RocksDB config (#4561)
lhotari Apr 1, 2025
87915a7
Ensure that formatVersion is specified for all RocksDB dbs (#4559)
lhotari Apr 1, 2025
db2cba9
Improve locating config files (#4560)
lhotari Apr 2, 2025
b3d61c7
Reduce metadataLock contention in LedgerHandle (#4549)
lifepuzzlefun Apr 16, 2025
6ae67fe
Upgrade Netty to 4.1.119, tcnative to 2.0.70 and io_uring to 0.0.26 (…
lhotari Apr 16, 2025
2d2318c
Upgrade Apache Commons libraries to compatible versions (#4582)
lhotari Apr 16, 2025
00517c0
Fix the coredump that occurs when calling KeyValueStorageRocksDB.coun…
zhaizhibo Apr 17, 2025
7683944
Improve auto-recovery noise log when some bookie down. (#4118)
horizonzy Jan 10, 2024
4348854
[cli] Fix: recover command doesn't accept rate limit parameter (#4535)
dlg99 Feb 14, 2025
8cbf32f
Upgrade Netty to 4.1.121.Final (#4597)
lhotari Apr 27, 2025
35e8310
Fix check read failed entry memory leak issue. (#4513)
horizonzy May 28, 2025
4c630e2
Fix the data loss issue that caused by the wrong entry log header (#4…
zymap May 30, 2025
3c04410
Fix region aware placement policy disk weight dose not update. (#4522)
dragonls Feb 14, 2025
5df87ad
remove in address2Region while bookie left to get correct rack info (…
ethqunzhong Feb 15, 2025
bdfeab6
[fix] Write stuck due to pending add callback by multiple threads (#4…
poorbarcode May 14, 2025
06e144d
fix branch-4.16 ci (#4612)
hangc0276 Jun 5, 2025
5950a41
fix pendingDeletedLedgers do not remove ledger error (#4525)
TakaHiR07 Feb 14, 2025
196bc1f
Adjust DNS cache expiration in tests to reduce test timeout failures …
lhotari Apr 22, 2025
83c6aee
Upgrade Jetty to 9.4.57.v20241219 to address CVE-2024-6763 (#4600)
lhotari May 6, 2025
f767b3b
Update python version to 4.16.7
StevenLuMT Jun 18, 2025
ba65055
fix cherry-pick: Upgrade Jetty to 9.4.57.v20241219 to address CVE-202…
StevenLuMT Jul 7, 2025
f6ea528
Fix: Garbage collection stuck on corrupt entry log file (#4544)
dlg99 Feb 13, 2025
f09de9f
Log all the error in the GarbageCollectorThread (#4649)
zymap Aug 12, 2025
860e370
[fix]Wrong error code(-107) of opening a deleted ledger (#4657)
poorbarcode Sep 2, 2025
95da62e
[fix]BK stays at read_only state even if the disk is empty (#4640)
poorbarcode Sep 17, 2025
d9a7a8f
Bring back the old public method name (#4682)
zymap Nov 24, 2025
a8708eb
Skipped license check for com.datastax.oss binaries
mukesh-ctds Feb 10, 2025
2e1f4d2
[fix]compile error of the file native_io_jni.c for the env jdk11 & wi…
poorbarcode Oct 22, 2025
609a987
Replace net.jpountz.lz4:lz4 with at.yawk.lz4:lz4-java (#4696)
massakam Jan 12, 2026
4a471bd
Upgrade to grpc 1.72.0 (#4591)
lhotari Apr 17, 2025
f7ea012
Revert "Upgrade to grpc 1.72.0 (#4591)"
manas-ctds Feb 27, 2026
0da9075
fix cherry-pick : corrected required module names and removed dead link
priyanshu-ctds Jul 21, 2025
e063496
fix cherry-pick: corrected module names and removed dead link
priyanshu-ctds Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/actions/tune-runner-vm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ runs:

# stop Azure Linux agent to save RAM
sudo systemctl stop walinuxagent.service || true

# enable docker experimental mode which is
# required for using "docker build --squash" / "-Ddocker.squash=true"
daemon_json="$(sudo cat /etc/docker/daemon.json | jq '.experimental = true')"
echo "$daemon_json" | sudo tee /etc/docker/daemon.json
# restart docker daemon
sudo systemctl restart docker
echo '::endgroup::'

# show memory
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/bk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ on:
branches:
- master
- branch-*
- ds-*
push:
branches:
- master
- branch-*
- ds-*
workflow_dispatch:

env:
MAVEN_OPTS: -Xss1500k -Xmx1500m -Daether.connector.http.reuseConnections=false -Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard -Dmaven.wagon.rto=60000
NIST_NVD_API_KEY: ${{ secrets.NIST_NVD_API_KEY }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -154,6 +157,13 @@ jobs:
distribution: 'temurin'
java-version: 11

- name: Tune Java DNS TTL settings
run: |
sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
networkaddress.cache.ttl=1
networkaddress.cache.negative.ttl=1
EOF

- name: Build
run: |
projects_list=
Expand Down Expand Up @@ -228,6 +238,13 @@ jobs:
distribution: 'temurin'
java-version: 11

- name: Tune Java DNS TTL settings
run: |
sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
networkaddress.cache.ttl=1
networkaddress.cache.negative.ttl=1
EOF

- name: Pick ubuntu mirror for the docker image build
run: |
# pick the closest ubuntu mirror and set it to UBUNTU_MIRROR environment variable
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bk-streamstorage-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ on:
branches:
- master
- branch-*
- ds-*
paths:
- 'stream/**'
- '.github/workflows/bk-streamstorage-python.yml'
push:
branches:
- master
- branch-*
- ds-*
paths:
- 'stream/**'
- '.github/workflows/bk-streamstorage-python.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dead-link-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
branches:
- master
- branch-*
- ds-*
paths:
- '**.md'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/website-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
branches:
- master
- branch-*
- ds-*
paths:
- 'site3/**'
- '.github/workflows/website-pr-validation.yaml'
Expand Down
2 changes: 1 addition & 1 deletion bin/bkctl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ source ${BK_HOME}/bin/common.sh
source ${BK_HOME}/conf/bk_cli_env.sh

CLI_MODULE_PATH=tools/all
CLI_MODULE_NAME="(org.apache.bookkeeper-)?bookkeeper-tools"
CLI_MODULE_NAME="(com.datastax.oss-)?bookkeeper-tools"
CLI_MODULE_HOME=${BK_HOME}/${CLI_MODULE_PATH}

# find the module jar
Expand Down
2 changes: 1 addition & 1 deletion bin/bkperf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source ${BK_HOME}/bin/common.sh
source ${BK_HOME}/conf/bk_cli_env.sh

CLI_MODULE_PATH=tools/perf
CLI_MODULE_NAME="(org.apache.bookkeeper-)?bookkeeper-perf"
CLI_MODULE_NAME="(com.datastax.oss-)?bookkeeper-perf"
CLI_MODULE_HOME=${BK_HOME}/${CLI_MODULE_PATH}

# find the module jar
Expand Down
4 changes: 2 additions & 2 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ CLI_GC_OPTS=${CLI_GC_OPTS:-"${DEFAULT_CLI_GC_OPTS}"}
CLI_GC_LOGGING_OPTS=${CLI_GC_LOGGING_OPTS:-"${DEFAULT_CLI_GC_LOGGING_OPTS}"}

# module names
BOOKIE_SERVER_MODULE_NAME="(org.apache.bookkeeper-)?bookkeeper-server"
TABLE_SERVICE_MODULE_NAME="(org.apache.bookkeeper-)?stream-storage-server"
BOOKIE_SERVER_MODULE_NAME="(com.datastax.oss-)?bookkeeper-server"
TABLE_SERVICE_MODULE_NAME="(com.datastax.oss-)?stream-storage-server"

is_released_binary() {
if [ -d ${BK_HOME}/lib ]; then
Expand Down
2 changes: 1 addition & 1 deletion bin/dlog
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BK_HOME=`cd ${BINDIR}/..;pwd`

source ${BK_HOME}/bin/common.sh

DLOG_MODULE_NAME="(org.apache.distributedlog-)?distributedlog-core"
DLOG_MODULE_NAME="(com.datastax.oss-)?distributedlog-core"
DLOG_MODULE_PATH=stream/distributedlog/core
DLOG_MODULE_HOME=${BK_HOME}/${DLOG_MODULE_PATH}

Expand Down
10 changes: 10 additions & 0 deletions bookkeeper-common-allocator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ static ByteBufAllocatorBuilder create() {
* <p>Default is {@link LeakDetectionPolicy#Disabled}
*/
ByteBufAllocatorBuilder leakDetectionPolicy(LeakDetectionPolicy leakDetectionPolicy);

ByteBufAllocatorBuilder exitOnOutOfMemory(boolean exitOnOutOfMemory);
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public class ByteBufAllocatorBuilderImpl implements ByteBufAllocatorBuilder {
OutOfMemoryPolicy outOfMemoryPolicy = OutOfMemoryPolicy.FallbackToHeap;
Consumer<OutOfMemoryError> outOfMemoryListener = null;
LeakDetectionPolicy leakDetectionPolicy = LeakDetectionPolicy.Disabled;
boolean exitOnOutOfMemory = false;

@Override
public ByteBufAllocatorWithOomHandler build() {
return new ByteBufAllocatorImpl(pooledAllocator, unpooledAllocator, poolingPolicy, poolingConcurrency,
outOfMemoryPolicy, outOfMemoryListener, leakDetectionPolicy);
outOfMemoryPolicy, outOfMemoryListener, leakDetectionPolicy, exitOnOutOfMemory);
}

@Override
Expand Down Expand Up @@ -86,4 +87,10 @@ public ByteBufAllocatorBuilder leakDetectionPolicy(LeakDetectionPolicy leakDetec
return this;
}

@Override
public ByteBufAllocatorBuilder exitOnOutOfMemory(boolean exitOnOutOfMemory) {
this.exitOnOutOfMemory = exitOnOutOfMemory;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.bookkeeper.common.allocator.LeakDetectionPolicy;
import org.apache.bookkeeper.common.allocator.OutOfMemoryPolicy;
import org.apache.bookkeeper.common.allocator.PoolingPolicy;
import org.apache.bookkeeper.common.util.ShutdownUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -48,15 +49,24 @@ public class ByteBufAllocatorImpl extends AbstractByteBufAllocator implements By
private final PoolingPolicy poolingPolicy;
private final OutOfMemoryPolicy outOfMemoryPolicy;
private Consumer<OutOfMemoryError> outOfMemoryListener;
private final boolean exitOnOutOfMemory;

ByteBufAllocatorImpl(ByteBufAllocator pooledAllocator, ByteBufAllocator unpooledAllocator,
PoolingPolicy poolingPolicy, int poolingConcurrency, OutOfMemoryPolicy outOfMemoryPolicy,
Consumer<OutOfMemoryError> outOfMemoryListener,
LeakDetectionPolicy leakDetectionPolicy) {
super(poolingPolicy == PoolingPolicy.PooledDirect /* preferDirect */);
this(pooledAllocator, unpooledAllocator, poolingPolicy, poolingConcurrency, outOfMemoryPolicy,
outOfMemoryListener, leakDetectionPolicy, false);
}

ByteBufAllocatorImpl(ByteBufAllocator pooledAllocator, ByteBufAllocator unpooledAllocator,
PoolingPolicy poolingPolicy, int poolingConcurrency, OutOfMemoryPolicy outOfMemoryPolicy,
Consumer<OutOfMemoryError> outOfMemoryListener,
LeakDetectionPolicy leakDetectionPolicy, boolean exitOnOutOfMemory) {
super(poolingPolicy == PoolingPolicy.PooledDirect /* preferDirect */);
this.poolingPolicy = poolingPolicy;
this.outOfMemoryPolicy = outOfMemoryPolicy;
this.exitOnOutOfMemory = exitOnOutOfMemory;
if (outOfMemoryListener == null) {
this.outOfMemoryListener = (v) -> {
log.error("Unable to allocate memory", v);
Expand Down Expand Up @@ -146,7 +156,7 @@ protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) {
: unpooledAllocator;
return alloc.heapBuffer(initialCapacity, maxCapacity);
} catch (OutOfMemoryError e) {
outOfMemoryListener.accept(e);
consumeOOMError(e);
throw e;
}
}
Expand All @@ -166,12 +176,12 @@ private ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity, boolean ca
try {
return unpooledAllocator.heapBuffer(initialCapacity, maxCapacity);
} catch (OutOfMemoryError e2) {
outOfMemoryListener.accept(e2);
consumeOOMError(e2);
throw e2;
}
} else {
// ThrowException
outOfMemoryListener.accept(e);
consumeOOMError(e);
throw e;
}
}
Expand All @@ -181,12 +191,24 @@ private ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity, boolean ca
try {
return unpooledAllocator.directBuffer(initialCapacity, maxCapacity);
} catch (OutOfMemoryError e) {
outOfMemoryListener.accept(e);
throw e;
consumeOOMError(e);
throw e;
}
}
}

private void consumeOOMError(OutOfMemoryError outOfMemoryError) {
try {
outOfMemoryListener.accept(outOfMemoryError);
} catch (Throwable e) {
log.warn("Consume outOfMemory error failed.", e);
}
if (exitOnOutOfMemory) {
log.info("Exiting JVM process for OOM error: {}", outOfMemoryError.getMessage(), outOfMemoryError);
ShutdownUtil.triggerImmediateForcefulShutdown();
}
}

@Override
public boolean isDirectBufferPooled() {
return pooledAllocator != null && pooledAllocator.isDirectBufferPooled();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.bookkeeper.common.util;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import lombok.extern.slf4j.Slf4j;

/**
* Forked from <a href="https://github.com/apache/pulsar">Pulsar</a>.
*/
@Slf4j
public class ShutdownUtil {
private static final Method log4j2ShutdownMethod;

static {
// use reflection to find org.apache.logging.log4j.LogManager.shutdown method
Method shutdownMethod = null;
try {
shutdownMethod = Class.forName("org.apache.logging.log4j.LogManager")
.getMethod("shutdown");
} catch (ClassNotFoundException | NoSuchMethodException e) {
// ignore when Log4j2 isn't found, log at debug level
log.debug("Cannot find org.apache.logging.log4j.LogManager.shutdown method", e);
}
log4j2ShutdownMethod = shutdownMethod;
}

/**
* Triggers an immediate forceful shutdown of the current process.
*
* @param status Termination status. By convention, a nonzero status code indicates abnormal termination.
* @see Runtime#halt(int)
*/
public static void triggerImmediateForcefulShutdown(int status) {
triggerImmediateForcefulShutdown(status, true);
}
public static void triggerImmediateForcefulShutdown(int status, boolean logging) {
try {
if (status != 0 && logging) {
log.warn("Triggering immediate shutdown of current process with status {}", status,
new Exception("Stacktrace for immediate shutdown"));
}
shutdownLogging();
} finally {
Runtime.getRuntime().halt(status);
}
}

private static void shutdownLogging() {
// flush log buffers and shutdown log4j2 logging to prevent log truncation
if (log4j2ShutdownMethod != null) {
try {
// use reflection to call org.apache.logging.log4j.LogManager.shutdown()
log4j2ShutdownMethod.invoke(null);
} catch (IllegalAccessException | InvocationTargetException e) {
log.error("Unable to call org.apache.logging.log4j.LogManager.shutdown using reflection.", e);
}
}
}

/**
* Triggers an immediate forceful shutdown of the current process using 1 as the status code.
*
* @see Runtime#halt(int)
*/
public static void triggerImmediateForcefulShutdown() {
triggerImmediateForcefulShutdown(1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* defines the utilities for allocator used across the project.
*/
package org.apache.bookkeeper.common.util;
Loading
Loading