This commit is contained in:
1 parent
b724a21a0d
commit
d73fa2c435
45 files changed
+2733
-226
No files matched your search
@@ -4,6 +4,14 @@ ObjectStore is development software. Do not use it for production data. It is pr
|
||||
|
||||
Run the commands below from the repository root.
|
||||
|
||||
## Gitea CI
|
||||
|
||||
`.gitea/workflows/ci.yml` runs Java and Rust client tests, packaging checks, the
|
||||
Docker build, and metadata/recovery/failover tests sequentially on the
|
||||
`objectstore-ci` runner. It runs on pushes and manual dispatch, not public fork
|
||||
pull requests. Java packages and JSON test reports are saved as build artifacts
|
||||
for 14 days. CI does not publish releases or overwrite package registries.
|
||||
|
||||
## Source tests
|
||||
|
||||
Requires JDK 21. No Docker service is needed.
|
||||
@@ -17,6 +25,7 @@ The script compiles the source and test programs into `out/classes`, then runs:
|
||||
| Test | Checks |
|
||||
| --- | --- |
|
||||
| `StoreTest` | Signature V4 and signed-stream vectors, CRC64NVME and XXHash reference vectors, local writes and reads, quotas, restart persistence for objects, checksums, ACLs, attributes, buckets, and versions, multipart recovery, legacy reads, locking, and corruption rejection. |
|
||||
| `LargeObjectTest` | Configured large-object boundaries, bounded streaming buffers, truncated oversized PUT and multipart bodies, and sparse-file reads, ranges, restart, and deletion above 2 GiB with a small heap. Sparse files exercise offsets without writing gigabytes of payload. |
|
||||
| `DiskBucketNamesTest` | Renaming a populated bucket while retaining versions, policies, and multipart uploads across restarts; default-bucket startup, deletion recovery, and old-name rejection. |
|
||||
| `ConditionalEditTest` | Atomic editor saves, concurrent uploads, changed ACLs/tags, versioning changes, and renamed buckets. |
|
||||
| `ClusterRepairCliTest` | Repair CLI entrypoint and argument validation. |
|
||||
@@ -42,11 +51,65 @@ The local installer was also checked with a disposable Compose project and separ
|
||||
|
||||
The encrypted Compose overlays can be checked with `docker compose config` without starting the stack. This verifies their bind mounts and startup settings, not that a host filesystem is actually encrypted. `scripts/prepare-encrypted-storage.sh` must also verify an active dm-crypt-backed mount. A complete deployment drill must unlock it, prepare directories, start with the overlay, write data, restart, restore from backup, and confirm that the stack refuses to start while the mount is unavailable. Do not point that drill at existing data.
|
||||
|
||||
Run `python3 client/scripts/test-packaging.py` to build the Java client twice and verify source-derived versions, embedded license notices, Maven metadata, checksums, and rejection of mislabeled versions. This does not publish artifacts.
|
||||
|
||||
Run `node test/admin-workspace.test.cjs` with Node.js to check that a late access-check response cannot replace a newer page after navigation. This test uses a small DOM harness and does not require a browser.
|
||||
|
||||
## Bounded workloads and recovery checks
|
||||
|
||||
Requires Python 3.9 or newer. Run `python3 scripts/test-readiness.py` for the runner's own checks: byte caps, corrupt/missing objects, ownership protection, cleanup isolation, and incomplete-manifest rejection.
|
||||
|
||||
`scripts/readiness.py` creates a uniquely named test bucket. It repeatedly uploads an object, checks its SHA-256 on download, checks HEAD, and deletes three out of every four objects. Retained objects allow a separate integrity check after a restart or restore. Existing buckets are not selected. Set `S3_ACCESS_KEY` and `S3_SECRET_KEY` in the environment for a **test service**, then run:
|
||||
|
||||
```sh
|
||||
python3 scripts/readiness.py run \
|
||||
--endpoint http://127.0.0.1:9000 --output out/readiness-short \
|
||||
--duration 30 --concurrency 4 --size 4096 \
|
||||
--max-write-bytes 16777216 --max-objects 4096
|
||||
python3 scripts/readiness.py verify --manifest out/readiness-short/manifest.json
|
||||
python3 scripts/readiness.py cleanup --manifest out/readiness-short/manifest.json
|
||||
```
|
||||
|
||||
The output directory must be new. `report.json` records the exact settings, duration, stop reason, per-operation successes and failures, status counts, payload throughput, and latency histograms. Percentiles are upper bounds from bins no wider than 10%; they include failed attempts. These numbers describe the tested machine and workload, not a service-wide performance guarantee. The write budget counts attempted workload payload, including failed PUTs; the 32-byte ownership marker, filesystem metadata, replicas, and backups consume additional bytes. The runner also caps concurrency at 32, object size at 1 MiB, total attempted payload at 1 GiB, and object count at 100,000. Verification and cleanup stop after ten failed requests and exit nonzero.
|
||||
|
||||
A paced soak uses the same runner, for example:
|
||||
|
||||
```sh
|
||||
python3 scripts/readiness.py run \
|
||||
--endpoint http://127.0.0.1:9000 --output out/readiness-soak \
|
||||
--duration 1800 --writes-per-second 2 --concurrency 2 \
|
||||
--max-write-bytes 67108864 --max-objects 16384
|
||||
```
|
||||
|
||||
The run stops when its duration, byte budget, or object budget is reached. A 30-minute run at two 4-KiB writes per second attempts about 14 MiB of payload. Budget exhaustion is reported explicitly; a short run is not a completed long soak. Use HTTPS for non-loopback endpoints. Credentials never go into the report or manifest.
|
||||
|
||||
For a service interruption, add `--retain-all` to avoid ambiguous unacknowledged deletes. Keep the runner alive on a separate machine while interrupting only the disposable test service. Verification requires a completed manifest and checks every retained acknowledged PUT; failed PUTs may or may not have reached the service. The manifest is saved when the runner completes, so killing the runner itself cannot establish durability. `verify --endpoint https://restored.example` checks a separately restored service against that same manifest. `cleanup` checks the ownership marker and deletes only keys recorded by that run; it refuses to remove a bucket containing unrelated objects. Versioning should remain disabled on the disposable test bucket.
|
||||
|
||||
An automated **single-machine** crash and cold-restore drill creates its own labelled containers, fresh volumes, credentials, and random loopback ports:
|
||||
|
||||
```sh
|
||||
docker build -t objectstore-readiness:local .
|
||||
python3 scripts/test-recovery.py --image objectstore-readiness:local \
|
||||
--output out/recovery-check
|
||||
```
|
||||
|
||||
The drill first verifies twenty retained objects, then sends a ten-second workload capped at 2 MiB of attempted payload, kills only its own service container, restarts it, and verifies acknowledged data. It then stops the source, exports its volume, restores into a separate empty volume, starts a second service, and verifies the same data, including the twenty objects acknowledged before the crash. Its `summary.json` records the image digest, snapshot digest, outcome, and cleanup status. Containers and volumes are removed by exact ownership label; reports and the small snapshot remain in the specified directory. It never restarts a host or uses an existing service. This is a local cold-volume restore, not a live multi-host or off-site backup test.
|
||||
|
||||
## Disposable metadata routing test
|
||||
|
||||
Run `sh scripts/test-metadata.sh` with Docker Compose. It creates a separate, temporary PostgreSQL container and two in-process storage nodes. The test connects through a two-host JDBC URL whose first host is unavailable, checks writable readiness, then makes the test database read-only and verifies that readiness drops. The script removes its test containers and temporary database afterward. It does not promote a standby or test automatic failover.
|
||||
Run `sh scripts/test-metadata.sh` with Docker Compose. It creates a separate, temporary PostgreSQL container and two in-process storage nodes. The test connects through a two-host JDBC URL whose first host is unavailable, checks writable readiness, then makes the test database read-only and verifies that readiness drops. The script removes its test containers and temporary database afterward. It also tests shared encrypted credentials through two HTTP gateways, scoped access, cross-gateway revocation, immutable request snapshots, concurrent edits, stale-read and revision-rollback rejection, and bucket rename/delete guards. It does not promote a standby; the separate drill below covers that. Set `OBJECTSTORE_TEST_IMAGE` to an image already built from this checkout to avoid rebuilding.
|
||||
|
||||
## Metadata high availability drill
|
||||
|
||||
With Docker Compose and Python installed, run:
|
||||
|
||||
```sh
|
||||
python3 scripts/test-ha.py --output out/ha-report.json
|
||||
```
|
||||
|
||||
Use `--image objectstore-test:local` to reuse a freshly built image. The drill creates an isolated Patroni/PostgreSQL cluster with three etcd voters, two storage nodes, and one gateway. It checks automatic promotion after primary termination, reconnection without restarting the gateway, old-primary rejoin, refusal to acknowledge writes without synchronous replicas, and recovery after losing DCS quorum. SHA-256 verification covers objects acknowledged before and after failover. Cleanup removes only the uniquely named test project and its volumes; failure to clean up fails the run.
|
||||
|
||||
This runs on one physical machine. It does not prove fencing, independent failure domains, or network-partition behavior across real hosts. The [HA reference](tests/ha/README.md) explains its test-only credentials, plaintext internal connections, disabled watchdog, and deployment requirements. Run it separately from other builds or drills on a memory-constrained machine. CI runs the build, metadata, recovery, and HA checks sequentially and retains JSON reports.
|
||||
|
||||
## Disposable Docker cluster tests
|
||||
|
||||
@@ -73,7 +136,7 @@ If port 9001 is occupied, set `CLUSTER_HOST_PORT` to the same free port in both
|
||||
|
||||
The Docker suite checks signed capability discovery and S3 operations, bucket creation and deletion, metadata and tags, public-read ACLs and anonymous access, copies, upload checksums, multi-segment objects, concurrent overwrites, multipart staging and listings, versioned reads and delete markers, versioned multipart completion, completion after a gateway restart and node loss, reads and writes with a node stopped, refusal to write without a storage quorum, restart recovery, corrupt-replica repair including staged parts, metadata unavailability, read-only metadata readiness rejection, and placement on a newly joined node. It then checks rebalance to the fourth node, automatic repair, garbage collection dry run and delayed deletion, and a metadata backup restored to a separate PostgreSQL instance while the original database is stopped. A two-host JDBC URL selects that restored writable database. Historical regular and multipart versions are checked after repair and cleanup. It also checks that containers labeled as one physical host cannot satisfy the normal host quorum. Its local-only override permits the remaining phases to use containers as separate test domains.
|
||||
|
||||
`ClusterMigrationTest` is a separate legacy-format fixture and is **not** run by either test script. Do not run its `create` phase against a populated metadata database. The migration procedure is in the [README](README.md#migrating-a-local-cluster).
|
||||
`ClusterMigrationTest` is a separate legacy-format fixture and is **not** run by either test script. Do not run its `create` phase against a populated metadata database. The migration procedure is in the [README](OPERATIONS.md#migrating-a-local-cluster).
|
||||
|
||||
`ClusterBucketRenameTest` is another standalone test for a fresh, disposable PostgreSQL database. It checks the transaction, metadata tables, duplicate-name rollback, restart, and refusal to recreate a renamed default bucket. Never point it at an existing metadata database.
|
||||
|
||||
@@ -87,6 +150,6 @@ The [manual two-machine drill](tests/two-host/README.md) uses machine A and mach
|
||||
|
||||
- Container stops are not physical power cuts or disk failures. The automated suite does not reboot a host or test every possible crash point.
|
||||
- The Compose nodes share one machine. Passing the local-only quorum override does not demonstrate durability across independent hosts, racks, or sites.
|
||||
- The suite does not test automatic metadata failover, an off-site backup restore, prolonged load, or full AWS S3 compatibility. `scripts/test.sh` checks scoped keys, CORS, and metrics. A separate local cold-snapshot drill restored one object into fresh single-node and cluster Compose projects and confirmed its bytes; the single-node restore also refused a nonempty destination. This does not test a multi-host restore. The Rust client passed live local upload/download and presigned GET/PUT smoke tests, but is not covered by the Java test script.
|
||||
- The local HA drill tests automatic metadata failover with disposable containers. The suite does not prove an off-site backup restore, prolonged production load, or full AWS S3 compatibility. `scripts/test.sh` checks scoped keys, CORS, and metrics. A separate local cold-snapshot drill restored one object into fresh single-node and cluster Compose projects and confirmed its bytes; the single-node restore also refused a nonempty destination. This does not test a multi-host restore. The Rust client passed live local upload/download and presigned GET/PUT smoke tests, but is not covered by the Java test script.
|
||||
|
||||
See [Limits and safety](README.md#limits-and-safety) before evaluating any multi-server deployment.
|
||||
See [Limits and safety](OPERATIONS.md#limits-and-safety) before evaluating any multi-server deployment.
|
||||
Reference in new issue
Block a user