HBASE-30087: Create a nightly Jenkins test for the Read-Replica feature - #8517
Conversation
|
Better add this to nightly or integration tests. Typically we do not require integration test when merging a PR. |
13b8d57 to
8678d7a
Compare
26d87ac to
63f626f
Compare
|
Hi @Apache9, thanks for the feedback! I updated the PR by adding a read-replica stage to Is there any way this updated Jenkinsfile can be tested with upstream Jenkins before merging the PR? |
anmolnar
left a comment
There was a problem hiding this comment.
Still looks good to me.
There was a problem hiding this comment.
🟡 Changes recommended
Malformed ZooKeeper configuration, version-dependent image packaging, ineffective timeouts, and missing license headers currently prevent reliable nightly execution.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds nightly Docker-based integration coverage for HBase Read-Replica clusters.
Changes:
- Adds a two-cluster Docker test environment.
- Adds Python tests for replication, read-only transitions, bulk loading, and region splits.
- Integrates execution and artifact collection into Jenkins nightly builds.
File summaries
| File | Description |
|---|---|
dev-support/Jenkinsfile |
Adds the nightly Read-Replica stage. |
dev-support/hbase_nightly_read_replica_test.sh |
Orchestrates build, tests, and cleanup. |
dev-support/read-replica/.env |
Defines test environment settings. |
dev-support/read-replica/Dockerfile |
Builds the HBase test image. |
dev-support/read-replica/build-images.sh |
Invokes the Docker build. |
dev-support/read-replica/docker-compose.yml |
Defines both HBase containers. |
dev-support/read-replica/requirements.txt |
Pins Python dependencies. |
dev-support/read-replica/cluster1/conf/hbase-site.xml |
Configures the active cluster. |
dev-support/read-replica/cluster1/conf/log4j2.properties |
Configures active-cluster logging. |
dev-support/read-replica/cluster1/conf/zoo.cfg |
Configures active-cluster ZooKeeper. |
dev-support/read-replica/cluster2/conf/hbase-site.xml |
Configures the replica cluster. |
dev-support/read-replica/cluster2/conf/log4j2.properties |
Configures replica-cluster logging. |
dev-support/read-replica/cluster2/conf/zoo.cfg |
Configures replica-cluster ZooKeeper. |
dev-support/read-replica/python/__init__.py |
Defines the Python package. |
dev-support/read-replica/python/proto/proto_compiler.py |
Generates Python protobuf bindings. |
dev-support/read-replica/python/scripts/__init__.py |
Defines the scripts package. |
dev-support/read-replica/python/scripts/verify_hbase_start.py |
Verifies cluster readiness. |
dev-support/read-replica/python/scripts/test_create_drop_behavior.py |
Tests table creation and deletion. |
dev-support/read-replica/python/scripts/test_put_get_delete_behavior.py |
Tests data mutation and refresh behavior. |
dev-support/read-replica/python/scripts/test_read_only_flag_flipping.py |
Tests repeated role transitions. |
dev-support/read-replica/python/scripts/test_dual_active_cluster_startup.py |
Tests rejection of dual-active startup. |
dev-support/read-replica/python/scripts/test_cannot_promote_second_active_cluster.py |
Tests rejection of a second promotion. |
dev-support/read-replica/python/scripts/test_bulkloaded_data_and_region_splits.py |
Tests bulk loads and region splits. |
dev-support/read-replica/python/src/__init__.py |
Exports shared Python helpers. |
dev-support/read-replica/python/src/environment_loader.py |
Loads required environment values. |
dev-support/read-replica/python/src/hbase_docker_client.py |
Implements Docker and HBase shell operations. |
dev-support/read-replica/python/src/logger_config.py |
Centralizes test logging. |
dev-support/read-replica/python/src/utils.py |
Provides shared test workflows. |
dev-support/read-replica/utils/bulkload.sh |
Generates and bulk-loads HFiles. |
dev-support/read-replica/utils/tsv_generator.py |
Generates bulk-load TSV data. |
Review details
- Files reviewed: 30/30 changed files
- Comments generated: 11
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
nit: do we really need this init file ? I saw few of them are empty with just the ASF header
| pass | ||
|
|
||
|
|
||
| class HBaseDockerClient: |
There was a problem hiding this comment.
nit: this itself could be a single commit to start the container with hbase cluster and client
b999cbe to
b1bc179
Compare
62654b2 to
b5a22d5
Compare
- Some code was created using Claude Opus 4.6 Change-Id: I17da2eba97f7385540a564ba31c462d796347e4d
Change-Id: I74edb45cf1123e72c9445301c7333db18d1a67a3
Change-Id: Ia0249b0f86ad72cb5790dc8ea3d959e387f18f2c
…est to run test scripts Change-Id: I559c1c95a708620848e2360fb957671210c5cf64
Change-Id: I69f16a50c6485235aeb335556f8711dafb75f817
Change-Id: Ia5a278d2f2446f8ed26779256caed631a42e233c
…test.sh Change-Id: I5a30ac9c0ea248a35166ee1c9d72b7a0cbe1ce33
Change-Id: I7644b4fdb31b51c64c2ecb56f9dfa2c868b2e519
b5a22d5 to
4f8dc1e
Compare
|
Changed the destination branch to |


HBASE-30087: Create a nightly Jenkins test for the Read-Replica feature
Note: Some code in the pull request was written using Claude Opus 4.6.
Introduction
HBase's Read-Replica feature was merged into master in PR #8364. This pull request introduces integration tests for Read-Replica via Jenkins and Docker containers. Jenkins and Docker containers have been useful for testing this feature because it works around the
META_TABLE_NAMEissue mentioned in HBASE-29691 and PR #7730.In a Read-Replica setup, clusters share the same storage location and need to have different
META_TABLE_NAMEs. The table names are distinguished using thehbase.meta.table.suffixconfiguration property. However, this still leads to problems when usingMiniHBaseClusterto test a multi-cluster Read-Replica setup because these clusters run in the same JVM and end up sharing the samestatic META_TABLE_NAMEvariable.How It Works
dev-support/Jenkinsfile.dev-support/read-replicadirectory contains various files for building a Docker image, running containers with HBase procecces, and running integration test scripts written in Python. It also contains files and directories used by HBase, such asconfdirectories.hbase_docker_client.pyfile is the most important Python file. Every test script uses this file to communicate with each hbase-docker container. It does so by usingdocker execto run commands in a container's HBase shell.The tests are triggered within a stage in HBase's nighly Jenkins run. The stage starts by cloning the current HBase repository to dev-support/read-replica. From here, the repo gets used to build a Docker image designed to run HBase in a Read-Replica setup. After the image has been built, two Docker containers are started, where one starts as the active cluster (read-write mode), and the other container starts as a replica cluster (read-only mode). These clusters share a
data-storedirectory containing thehbase.rootdir. It is a mounted volume between each container and the local filesystem, and it is created by the Python scripts before container startup. The directory is also given777permissions in order to avoid HBase startup failures. There are other volumes as well for easy access, such as each container'sconfdirectory, autilsdirectory for bulkloading data, and alogsdirectory for preserving HBase logs from each container.Once the containers are up and running, a series of Python scripts are run as integration tests. They test expected behavior for a Read-Replica cluster setup, such as verifying valid/invalid startup, blocking writes on replica clusters, being able to refresh meta and HFiles on replica clusters to make them consistent with the active cluster, read-only flag flipping (changing
hbase.global.readonly.enabledvia dynamic configuration), verifying bug fixes, etc. If the Jenkins stage finishes successfully or a failure occurs at any point, then the HBase logs are saved to the Jenkins output directory, the containers are stopped, and the Docker image is deleted.Other Information
docker-compose.ymldefines and configures two hbase-docker containers capable of running in a read-replica setup.build_images.shusesDockerfileto build an hbase-docker image. This script assumes there is anhbaserepo in the same directory..envdefines environment variables used bydocker-compose.yml,build_images.sh, and Python scripts.proto_compiler.pycopiesActiveClusterSuffix.protofrom the hbase repo and compiles it. The generated output is used for verifying theactive.cluster.suffix.idfile.utilsis a directory containing scripts for bulkloading data into HBase.cluster1andcluster2directories contain cluster-specific conf files and HBase log output directories. They each contain their ownhbase-site.xml,log4j2.properties, andzoo.cfgfiles. The directories are defined as mounted volumes indocker-compose.yml. This is especially useful for changing the value ofhbase.global.readonly.enabledin order to change a cluster's read-only mode. The mounted logs directory is useful because it helps preserve the HBase logs so they can be copied to the Jenkins output directory if a test failure occurs.