Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
119 changes: 119 additions & 0 deletions rustfs-storage-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ validation_evidence_items() {
validation_write_result() {
local verdict="$1" reason="$2" cleanup_status="$3" item
local profile=single-4disk
if [ "${VALIDATION_SOURCE_CASE_ID}" = STOR-136 ]; then profile=single-1disk; fi
if [ "${VALIDATION_CASE}" = scanner.status-readiness ] || [[ "${VALIDATION_CASE}" == ilm.* ]]; then
profile=ilm-2x4
fi
Expand Down Expand Up @@ -766,6 +767,7 @@ run_all_tests() {
run_test STOR-133 "InlineCapacity" test_stor133
run_test STOR-134 "AdminUsageConverges" test_stor134
run_test STOR-135 "DeepKeyListingResilience" test_stor135
run_test STOR-136 "BoundedCompressedRangeGet" test_stor136
}

test_stor134() { # admin usage APIs must respond promptly and converge to actual object counts (#1858 #2232 #5116)
Expand Down Expand Up @@ -1113,6 +1115,121 @@ test_stor106() {
rm_bucket "stor106-b1"
}

# Capture bytes returned by read syscalls, including page-cache hits. The
# single-node fixture prevents internode traffic from inflating this counter.
stor136_read_counter() {
run_remote "${NODES[0]}" <<'REMOTE'
set -eu
pid=$(systemctl show --property MainPID --value rustfs)
test "${pid}" -gt 1
sudo_cmd=()
if [ "$(id -u)" -ne 0 ]; then sudo_cmd=(sudo -n); fi
bytes=$("${sudo_cmd[@]}" awk '$1 == "rchar:" { print $2 }' "/proc/${pid}/io")
printf '%s %s\n' "${pid}" "${bytes}"
REMOTE
}

stor136_check_range() {
local bucket="$1" key="$2" source="$3" spec="$4" start="$5" source_start="$6" total="$7"
local length=16384 budget=$((16 * 1024 * 1024)) first_pid last_pid first_bytes last_bytes code
local content_range="bytes ${start}-$((start + length - 1))/${total}"
local body="${TEST_TMP}/stor136-body" headers="${TEST_TMP}/stor136-headers" snapshot
snapshot="$(stor136_read_counter)" || return 1
read -r first_pid first_bytes <<<"${snapshot}" || return 1
code="$(curl --noproxy '*' -sS --max-time "${API_REQUEST_TIMEOUT}" \
--aws-sigv4 "aws:amz:${REGION}:s3" --user "${ACCESS_KEY}:${SECRET_KEY}" \
-H "Range: bytes=${spec}" -D "${headers}" -o "${body}" -w '%{http_code}' \
"${ENDPOINT}/${bucket}/${key}")" || return 1
snapshot="$(stor136_read_counter)" || return 1
read -r last_pid last_bytes <<<"${snapshot}" || return 1
[ "${code}" = 206 ] || { echo "${key} bytes=${spec} returned HTTP ${code}, expected 206"; return 1; }
tr -d '\r' < "${headers}" | grep -Fixq "Content-Range: ${content_range}" \
|| { echo "${key} bytes=${spec} returned the wrong Content-Range"; return 1; }
if ! dd if="${source}" iflag=skip_bytes,count_bytes bs=65536 skip="${source_start}" count="${length}" 2>/dev/null | cmp -s - "${body}"; then
echo "${key} bytes=${spec} returned different plaintext"
return 1
fi
if [[ "${first_pid}" != "${last_pid}" || ! "${first_pid}" =~ ^[0-9]+$ || \
! "${first_bytes}" =~ ^[0-9]+$ || ! "${last_bytes}" =~ ^[0-9]+$ ]]; then
echo "RustFS process identity or read counter is unavailable"
return 1
fi
local read_bytes=$((last_bytes - first_bytes))
echo "${key} bytes=${spec} HTTP ${code}, ${content_range}, read bytes ${read_bytes}, budget ${budget}"
if [ "${read_bytes}" -le 0 ] || [ "${read_bytes}" -ge "${budget}" ]; then
echo "Range read must observe positive read bytes below the budget"
return 1
fi
}

test_stor136() (
if [ "${CURRENT_TOPOLOGY}" != "${TOPO_SINGLE_SINGLE}" ]; then
echo "Compressed range read accounting requires the single-node, single-disk topology"
return 2
fi
local bucket status=0 single="${TEST_TMP}/stor136-single"
bucket="stor136-range-$(date +%s)-$$"
local block="${TEST_TMP}/stor136-block" first="${TEST_TMP}/stor136-first" last="${TEST_TMP}/stor136-last"
local mib=1048576 tail=32768 single_size=$((512 * 1048576 + 32768))
local part_size=$((64 * 1048576)) last_size=$((64 * 1048576 + 32768)) range_size=16384
local i start upload_id="" etag1 etag2 stored single_stored
# Half of each block is incompressible. This keeps a whole-part scan well
# above the read budget even though the object is actually disk-compressed.
head -c "$((mib / 2))" /dev/urandom > "${block}" || return 1
truncate -s "${mib}" "${block}" || return 1
for ((i = 0; i < 512; i++)); do cat "${block}" || return 1; done > "${single}"
head -c "${tail}" /dev/urandom >> "${single}" || return 1
head -c "${part_size}" "${single}" > "${first}" || return 1
tail -c "${last_size}" "${single}" > "${last}" || return 1
new_bucket "${bucket}" || return 1
trap '
status=$?
if [ -n "${upload_id}" ]; then
aws_run s3api abort-multipart-upload --bucket "${bucket}" --key multipart.txt --upload-id "${upload_id}"
assert_aws_ok "abort multipart upload" || status=1
fi
aws_run s3 rb "s3://${bucket}" --force
assert_aws_ok "remove range test bucket" || status=1
exit "${status}"
' EXIT

aws_run s3api put-object --bucket "${bucket}" --key single.txt --body "${single}"
assert_aws_ok "put compressed object" || return 1
single_stored="$(bucket_physical_bytes "${bucket}")" || return 1
if [ "${single_stored}" -le "$((single_size / 3))" ] || [ "${single_stored}" -ge "$((single_size * 3 / 4))" ]; then
echo "Unexpected disk-compressed single PUT size: ${single_stored}"
return 1
fi
for start in 1000 9999; do
stor136_check_range "${bucket}" single.txt "${single}" "${start}-$((start + range_size - 1))" \
"${start}" "${start}" "${single_size}" || return 1
done
start=$((single_size - range_size))
stor136_check_range "${bucket}" single.txt "${single}" "-${range_size}" "${start}" "${start}" "${single_size}" || return 1

aws_run s3api create-multipart-upload --bucket "${bucket}" --key multipart.txt
assert_aws_ok "create multipart upload" || return 1
upload_id="$(jq -er '.UploadId' <<<"${AWS_OUT}")" || return 1
aws_run s3api upload-part --bucket "${bucket}" --key multipart.txt --upload-id "${upload_id}" --part-number 1 --body "${first}"
assert_aws_ok "upload part one" || return 1
etag1="$(jq -cer '.ETag' <<<"${AWS_OUT}")" || return 1
aws_run s3api upload-part --bucket "${bucket}" --key multipart.txt --upload-id "${upload_id}" --part-number 2 --body "${last}"
assert_aws_ok "upload part two" || return 1
etag2="$(jq -cer '.ETag' <<<"${AWS_OUT}")" || return 1
aws_run s3api complete-multipart-upload --bucket "${bucket}" --key multipart.txt --upload-id "${upload_id}" \
--multipart-upload "{\"Parts\":[{\"ETag\":${etag1},\"PartNumber\":1},{\"ETag\":${etag2},\"PartNumber\":2}]}"
assert_aws_ok "complete multipart upload" || return 1
upload_id=""
stored="$(bucket_physical_bytes "${bucket}")" || return 1
stored=$((stored - single_stored))
if [ "${stored}" -le "$(((part_size + last_size) / 3))" ] || [ "${stored}" -ge "$(((part_size + last_size) * 3 / 4))" ]; then
echo "Unexpected disk-compressed multipart size: ${stored}"
return 1
fi
stor136_check_range "${bucket}" multipart.txt "${last}" "-${range_size}" \
"$((part_size + last_size - range_size))" "$((last_size - range_size))" "$((part_size + last_size))"
)

test_stor107() {
new_bucket "stor107-b1" || return 1
make_compressible_file "${TEST_TMP}/stor107-v" 1048576
Expand Down Expand Up @@ -1452,6 +1569,8 @@ main() {
if ilm_case_uses_tier; then
[ "${#NODES[@]}" -ge 3 ] || die "${VALIDATION_CASE} needs three test nodes"
fi
elif [ "${VALIDATION_SOURCE_CASE_ID}" = STOR-136 ]; then
SELECTED_TOPOLOGIES=("${TOPO_SINGLE_SINGLE}")
else
SELECTED_TOPOLOGIES=("${TOPO_SINGLE_MULTI}")
fi
Expand Down
26 changes: 26 additions & 0 deletions validation-cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -9540,6 +9540,32 @@
]
}
},
{
"id": "source-procedure.storage.stor-136",
"source_status": "procedure-ready",
"priority": "P1",
"channels": [
"s3-api"
],
"assertions": [
"Disk-compressed single PUT and multipart objects return HTTP 206, the exact Content-Range, and byte-identical plaintext at early offsets and at the tail.",
"The RustFS process stays the same between observations and its Linux read-byte counter advances by less than 16 MiB per 16 KiB range."
],
"probes": {
"sourceCase": "STOR-136",
"executionMode": "configured-endpoint",
"runner": "rustfs-storage-test.sh",
"topology": "single-1disk"
},
"reuse_candidates": {
"suites": [
"rustfs-storage-test.sh"
],
"case_ids": [
"STOR-136"
]
}
},
{
"id": "source-procedure.kms.kms-101",
"source_status": "procedure-ready",
Expand Down
6 changes: 3 additions & 3 deletions validation-migration-review.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"source_sha256": "463fdd02dee43e42fef4f3aacf7506709ce87af535e1a53d91c521bc2e361cad",
"reviewed_testing_commit": "5e76033d7ccad414aad1f7edb9867de6462eee43",
"scope": "Test implementation migration and candidate live acceptance are independent. This review does not rewrite original results, change migration_status semantics or relax the canonical gate. Environment procedures remain disabled by default under the accepted delivery scope.",
"evidence_basis": "20261026-canonical-migration-ledger-7094.json plus later G01/G02 attempts and source review on 2026-10-28; historical result bytes and audit reports remain in the separate evidence store. 2026-11-10: a scoped re-review of the Rebalance activity fixture, capacity admission, Started non-zero progress, and the early-completion diagnosis; this local regression adds no product live acceptance. 2026-11-22: reviewed the replication inventory pagination, Heal census completeness, expected-manifest comparison, ILM control survival, and exact marker oracles after automated review findings. Reviewed the 10-version NewerNoncurrentVersions retention procedure and source/target version-purge convergence evidence for this change. 2026-11-22: indexed the source-audit inventory and added individually dispatchable local compatibility and source-suite procedure entries with selector and candidate-admission checks. 2026-11-22: added table-catalog and upgrade procedure selectors with shared validation artifact wiring; dry-run selectors cover all 25 newly indexed procedures. 2026-11-22: clarified that source-native tests are used as assertion and boundary-value references; one-to-one native ports are outside the migration scope. 2026-11-24: re-reviewed the ILM scanner-readiness preflight after a 4-node VM run (auto-testing 644b935, RustFS 2d90297) blocked all 14 ILM cases because followers report effective_interval_available=false with a zero effective interval by design; the effective-interval comparison now runs only on the leader. This is a test-oracle correction and adds no product live acceptance. 2026-11-24: refreshed the reviewed digest for rustfs-s3-compat-test.sh to match current main (a3a9e83 and 6feeeec changed that script without updating this ledger); this PR does not modify the script, and the same digest mismatch reproduces on a clean origin/main checkout. 2026-11-24: refreshed the reviewed digest again for rustfs-s3-compat-test.sh after 90b4fe1 changed that script without updating this ledger; the main push of ba6051d failed the contract-tests job. This follow-up does not modify the script. 2026-11-24: accepted the product last_cycle_partial_reason=unknown sentinel in the ILM scanner-readiness preflight after a healthy leader was still blocked; this is a test-oracle correction and adds no product live acceptance. 2026-11-24: reviewed the new STOR-135 DeepKeyListingResilience case in rustfs-storage-test.sh (backlog#3293): a 301-segment key PUT followed by a recursive ListObjectsV2 must either return the key or fail with a controlled error while the server stays alive, and GET must return the same bytes. This is a test-oracle addition guarding the scan_dir recursion-depth fix; it adds no product live acceptance. 2026-11-25: fixed the S3C-206 fixture to send the single encoded metadata value it expects; the previous fixture sent two encoded words and the product preserved them exactly, so the case falsely failed. 2026-11-23: added strict SSE contract procedures ENC-201..ENC-210 (S3 compatibility suite) and KMS-601..KMS-609 (KMS suite), executed by scripts/sse_contract_cases.py and individually dispatchable; they were exercised against local single-process servers started with each suite's environment, which is no fleet live acceptance.",
"evidence_basis": "20261026-canonical-migration-ledger-7094.json plus later G01/G02 attempts and source review on 2026-10-28; historical result bytes and audit reports remain in the separate evidence store. 2026-11-10: a scoped re-review of the Rebalance activity fixture, capacity admission, Started non-zero progress, and the early-completion diagnosis; this local regression adds no product live acceptance. 2026-11-22: reviewed the replication inventory pagination, Heal census completeness, expected-manifest comparison, ILM control survival, and exact marker oracles after automated review findings. Reviewed the 10-version NewerNoncurrentVersions retention procedure and source/target version-purge convergence evidence for this change. 2026-11-22: indexed the source-audit inventory and added individually dispatchable local compatibility and source-suite procedure entries with selector and candidate-admission checks. 2026-11-22: added table-catalog and upgrade procedure selectors with shared validation artifact wiring; dry-run selectors cover all 25 newly indexed procedures. 2026-11-22: clarified that source-native tests are used as assertion and boundary-value references; one-to-one native ports are outside the migration scope. 2026-11-24: re-reviewed the ILM scanner-readiness preflight after a 4-node VM run (auto-testing 644b935, RustFS 2d90297) blocked all 14 ILM cases because followers report effective_interval_available=false with a zero effective interval by design; the effective-interval comparison now runs only on the leader. This is a test-oracle correction and adds no product live acceptance. 2026-11-24: refreshed the reviewed digest for rustfs-s3-compat-test.sh to match current main (a3a9e83 and 6feeeec changed that script without updating this ledger); this PR does not modify the script, and the same digest mismatch reproduces on a clean origin/main checkout. 2026-11-24: refreshed the reviewed digest again for rustfs-s3-compat-test.sh after 90b4fe1 changed that script without updating this ledger; the main push of ba6051d failed the contract-tests job. This follow-up does not modify the script. 2026-11-24: accepted the product last_cycle_partial_reason=unknown sentinel in the ILM scanner-readiness preflight after a healthy leader was still blocked; this is a test-oracle correction and adds no product live acceptance. 2026-11-24: reviewed the new STOR-135 DeepKeyListingResilience case in rustfs-storage-test.sh (backlog#3293): a 301-segment key PUT followed by a recursive ListObjectsV2 must either return the key or fail with a controlled error while the server stays alive, and GET must return the same bytes. This is a test-oracle addition guarding the scan_dir recursion-depth fix; it adds no product live acceptance. 2026-11-25: fixed the S3C-206 fixture to send the single encoded metadata value it expects; the previous fixture sent two encoded words and the product preserved them exactly, so the case falsely failed. 2026-11-23: added strict SSE contract procedures ENC-201..ENC-210 (S3 compatibility suite) and KMS-601..KMS-609 (KMS suite), executed by scripts/sse_contract_cases.py and individually dispatchable; they were exercised against local single-process servers started with each suite's environment, which is no fleet live acceptance. 2026-11-26: indexed STOR-136 for disk-compressed Range GET on a single-node single-disk deployment, with exact response bytes and a positive bounded process read-byte delta.",
"reviewed_files": {
"scripts/run_validation_case.sh": "58e0eb2fb007b28fb16b0fd4a25ac2f997cc9f01a4a3700c01fe7c9a6dd1a683",
"scripts/validation_heal/authority.py": "8f2225f184427674de1f45aff4c4976c812f9d70fd4bc927ce460726a4ff74a0",
Expand Down Expand Up @@ -124,9 +124,9 @@
"rustfs-s3-compat-test.sh": "31f986f574484da43f36fcc1ee74b0a088d83574202a91945a3473b49cab82aa",
"rustfs-security-test.sh": "02cddd15636df1e74210c172ee898dba9b3adf83943da45d874d6c827583d9d2",
"rustfs-tier-test.sh": "3b37a6b26a4af862d7f2d178872900f314c8328ffd3db6a3e769928a5d1b3964",
"rustfs-storage-test.sh": "197ffa9b8349d12db10678897a87209801e3c3d52ef08ec060801bd553762ab3",
"rustfs-storage-test.sh": "950657d31e2b9c33bc06e390f47ac166edf661573246e0900f6fa31b6a423b60",
"rustfs-kms-test.sh": "4a20d95a04287fa4d84d1ce58e074725cd0507163eaeb6e27e0ea7fc098c3bb0",
"validation-cases.json": "fe5946970206e59c1bb91cc414b183fdbbb0fbf3069a5c19c0720041db1ad81a",
"validation-cases.json": "07f674ae3e8eb8ca5ae77c8d85418d4755332939417999c92ae31a9603b11f66",
"docs/validation-migration-map.md": "b8dd536df1f1e14324f27bbe61cb3ea796aeb3f7220876c36a828e9d80a9dffc",
"docs/source-test-migration-inventory.md": "ac434d583c69f9c2a1128e4a84eb52d9bf46395f3fe22383b2a2d5ce9a0bddd5",
"test_source_test_migration_inventory.py": "5c0122c6940ea224e7bde57fa1159536ab9ef132cf9d34517fe27c053a56b972",
Expand Down