mirror of
https://github.com/rustfs/rustfs.git
synced 2026-11-26 18:32:42 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 739699426b | |||
| 0d2a0ea345 | |||
| c1f97d27f6 | |||
| 1066ab4d1d | |||
| b0e824437b | |||
| 913a5df515 | |||
| f483cfedc8 | |||
| f2177505da | |||
| a758b58bf2 | |||
| 9075131b23 | |||
| 050be16dc7 | |||
| 8efa1a96c0 | |||
| 444dbd9956 | |||
| 33e0fe8c6f | |||
| 205227b441 | |||
| 3e5d37742d | |||
| 8e6265907a |
@@ -1,500 +1,10 @@
|
||||
# Rulings for the gateway conformance lane. Each row covers the exact failure diagnostic(s) for one case.
|
||||
# Remove a row when the case passes. Review the referenced compatibility decision before expiry.
|
||||
# Backlog #2684 registers both R/K entries and the legacy response heads in rustfs/gateway#1159.
|
||||
# Official RustFS 1.0.5 and the gateway candidate both omit the region on a successful HeadBucket.
|
||||
|
||||
[[ruling]]
|
||||
case = "c-bkt-0008"
|
||||
ledger = "rustfs/gateway#1159"
|
||||
reason = "The RustFS profile preserves the absent bucket region on successful HeadBucket (rustfs/backlog#2684)."
|
||||
failure = "[expect/headers_present] at /expect/headers_present/x-amz-bucket-region: exchange #1, attempt 1: expected `x-amz-bucket-region: us-east-1`, observed no such header"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-bkt-0009"
|
||||
ledger = "rustfs/gateway#1159"
|
||||
reason = "The RustFS profile preserves the absent bucket region on successful HeadBucket (rustfs/backlog#2684)."
|
||||
failure = "[expect/headers_present] at /expect/headers_present/x-amz-bucket-region: exchange #1, attempt 1: expected `x-amz-bucket-region: us-east-1`, observed no such header"
|
||||
expires = 2027-02-01
|
||||
|
||||
# Connection-close ruling: https://github.com/rustfs/backlog/issues/2684#issuecomment-7124472117
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0013"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "The released and native hosts both close this HTTP/1 connection after serving the expected refusal."
|
||||
failure = "[expect/connection_after] at /expect/connection_after: exchange #1, attempt 1: expected the connection to be `open` afterwards, observed `closed`"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0016"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "The released and native hosts both close this HTTP/1 connection after serving the expected refusal."
|
||||
failure = "[expect/connection_after] at /expect/connection_after: exchange #1, attempt 1: expected the connection to be `open` afterwards, observed `closed`"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0021"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "The released and native hosts both close this HTTP/1 connection after serving the expected refusal."
|
||||
failure = "[expect/connection_after] at /expect/connection_after: exchange #1, attempt 1: expected the connection to be `open` afterwards, observed `closed`"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0026"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "The released and native hosts both close this HTTP/1 connection after serving the expected refusal."
|
||||
failure = "[expect/connection_after] at /expect/connection_after: exchange #1, attempt 1: expected the connection to be `open` afterwards, observed `closed`"
|
||||
expires = 2027-02-01
|
||||
|
||||
# Maintainer-signed accepted change: https://github.com/rustfs/backlog/issues/2684#issuecomment-7163283798
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0598"
|
||||
ledger = "rustfs/gateway#1349"
|
||||
reason = "Accepted change (R-053, rustfs/backlog#2684): unreadable access key grammar returns 403 AccessDenied instead of InvalidAccessKeyId."
|
||||
failures = [
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>InvalidAccessKeyId</Code>, the body carried <Code>AccessDenied</Code>",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>InvalidAccessKeyId</Code>\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
# Tracked IAM gap (R-065): https://github.com/rustfs/backlog/issues/2684#issuecomment-7163283798
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0020"
|
||||
ledger = "R-065"
|
||||
reason = "Tracked IAM gap (rustfs/rustfs#9559, rustfs/backlog#2684): expired STS session token returns 403 InvalidAccessKeyId instead of 400 ExpiredToken."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 403",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>ExpiredToken</Code>, the body carried <Code>InvalidAccessKeyId</Code>",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 52 (expected 196 bytes, observed 200 bytes)\n expected: …F-8\\\"?>\\n<Error><Code>ExpiredToken</Code><Message>the session …\n observed: …F-8\\\"?>\\n<Error><Code>InvalidAccessKeyId</Code><Message>The Ac…",
|
||||
"[expect/body.not_contains_utf8] at /expect/body: exchange #1, attempt 1: the body must not contain \"InvalidAccessKeyId\", found at byte 52",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
# Outer CORS middleware and HTTP/2 OPTIONS parity: https://github.com/rustfs/backlog/issues/2684#issuecomment-7163283798
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cors-0034"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS preflight 200 before bucket routing."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 403, observed 200",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>AccessForbidden</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: application/xml`, observed no such header",
|
||||
"[expect/headers_present] at /expect/headers_present/vary: exchange #1, attempt 1: expected `vary: origin`, observed `Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, Cookie, X-Amz-Security-Token, X-Amz-Content-Sha256`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 211 bytes, observed 0 bytes)\n expected: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…\n observed: ",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cors-0035"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS preflight 200 before bucket routing."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 403, observed 200",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>AccessForbidden</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: application/xml`, observed no such header",
|
||||
"[expect/headers_present] at /expect/headers_present/vary: exchange #1, attempt 1: expected `vary: origin`, observed `Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, Cookie, X-Amz-Security-Token, X-Amz-Content-Sha256`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 211 bytes, observed 0 bytes)\n expected: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…\n observed: ",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cors-0036"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS preflight 200 before bucket routing."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 403, observed 200",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>AccessForbidden</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: application/xml`, observed no such header",
|
||||
"[expect/headers_present] at /expect/headers_present/vary: exchange #1, attempt 1: expected `vary: origin`, observed `Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, Cookie, X-Amz-Security-Token, X-Amz-Content-Sha256`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 211 bytes, observed 0 bytes)\n expected: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…\n observed: ",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cors-0043"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware handles OPTIONS without CORS headers without returning an S3 XML BadRequest body."
|
||||
failure = "[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>BadRequest</Code>, the body carried no <Code> element at all"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cors-0058"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers half-preflight OPTIONS with empty 400 instead of S3 403 AccessForbidden XML."
|
||||
failures = [
|
||||
"[expect/status] at /exchanges/0/expect/status: exchange #1, attempt 1: expected status 403, observed 400",
|
||||
"[expect/error.code] at /exchanges/0/expect/error/code: exchange #1, attempt 1: expected <Code>AccessForbidden</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /exchanges/0/expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
"[expect/status] at /exchanges/1/expect/status: exchange #2, attempt 1: expected status 403, observed 400",
|
||||
"[expect/error.code] at /exchanges/1/expect/error/code: exchange #2, attempt 1: expected <Code>AccessForbidden</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /exchanges/1/expect/error/request_id_present: exchange #2, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0001"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0002"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0003"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS with an empty body, so a 1-byte HTTP/2 flow-control window finishes immediately."
|
||||
failures = [
|
||||
"[expect/kind] at /expect/kind: exchange #1, attempt 1: expected the exchange to end as `hang`, it ended as `response`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 1 bytes, observed 0 bytes)\n expected: <\n observed: ",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0008"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0010"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0017"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0018"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware serves OPTIONS over HTTP/2 with an empty body instead of S3 XML BadRequest."
|
||||
failure = "[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>BadRequest</Code>\""
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0019"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS with an empty body before the client RST_STREAM interrupts a response body."
|
||||
failures = [
|
||||
"[expect/kind] at /expect/kind: exchange #1, attempt 1: expected the exchange to end as `client_reset`, it ended as `response`",
|
||||
"[expect/h2_control_frames] at /expect/h2_control_frames: exchange #1, attempt 1: received HTTP/2 control frames differ in count, order, or fields",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 1 bytes, observed 0 bytes)\n expected: <\n observed: ",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-h2-0020"
|
||||
ledger = "rustfs/gateway#1120"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): outer CORS middleware answers OPTIONS with an empty body before the malformed RST_STREAM triggers a mid-body stream error."
|
||||
failures = [
|
||||
"[expect/kind] at /expect/kind: exchange #1, attempt 1: expected the exchange to end as `stream_error`, it ended as `response`",
|
||||
"[expect/stream_termination] at /expect/stream_termination: exchange #1, attempt 1: expected `abrupt_close`, observed `nothing`",
|
||||
"[expect/h2_control_frames] at /expect/h2_control_frames: exchange #1, attempt 1: received HTTP/2 control frames differ in count, order, or fields",
|
||||
"[expect/socket_read_after] at /expect/socket_read_after: exchange #1, attempt 1: receive-side termination: expected eof, observed no_termination_observed",
|
||||
"[expect/body_bytes_before_error] at /expect/body_bytes_before_error: exchange #1, attempt 1: expected 1 response bytes before the error, the transport did not record any",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
# Cleartext SSE-C error parity: https://github.com/rustfs/backlog/issues/2684#issuecomment-7163283798
|
||||
|
||||
[[ruling]]
|
||||
case = "c-ssec-0002"
|
||||
ledger = "rustfs/backlog#2762"
|
||||
reason = "Official 1.0.5 parity (rustfs/backlog#2684): cleartext GET with SSE-C headers on an absent object returns 404 NoSuchKey instead of 400 InvalidRequest."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 404",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>InvalidRequest</Code>, the body carried <Code>NoSuchKey</Code>",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 52 (expected 256 bytes, observed 163 bytes)\n expected: …F-8\\\"?>\\n<Error><Code>InvalidRequest</Code><Message>requests s…\n observed: …F-8\\\"?>\\n<Error><Code>NoSuchKey</Code><Message>The specified k…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
# Maintainer-signed 1.0.5-identical compatibility rulings: https://github.com/rustfs/backlog/issues/2684#issuecomment-7163283798
|
||||
|
||||
[[ruling]]
|
||||
case = "c-acl-0001"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: default bucket ACL reports the RustFS owner display name and canonical ID instead of the conformance fixture owner."
|
||||
failures = [
|
||||
"[expect/body.golden] at /expect/body: exchange #1, attempt 1: bodies differ at byte 234 (expected 555 bytes, observed 545 bytes)\n expected: …lUser\\\"><DisplayName>conformance</DisplayName><ID>3f6e2b1c4a8…\n observed: …lUser\\\"><DisplayName>rustfs</DisplayName><ID>c19050dbcee97fda…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-acl-0028"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: bucket ACL XML omits the newline after the XML declaration and uses the RustFS default owner."
|
||||
failures = [
|
||||
"[expect/body.golden] at /expect/body: exchange #1, attempt 1: bodies differ at byte 38 (expected 556 bytes, observed 545 bytes)\n expected: …\\\" encoding=\\\"UTF-8\\\"?>\\n<AccessControlPolicy xmlns=\\\"http://s3.a…\n observed: …\\\" encoding=\\\"UTF-8\\\"?><AccessControlPolicy xmlns=\\\"http://s3.am…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-acl-0029"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: object ACL XML omits the newline after the XML declaration and uses the RustFS default owner."
|
||||
failures = [
|
||||
"[expect/body.golden] at /expect/body: exchange #1, attempt 1: bodies differ at byte 38 (expected 556 bytes, observed 545 bytes)\n expected: …\\\" encoding=\\\"UTF-8\\\"?>\\n<AccessControlPolicy xmlns=\\\"http://s3.a…\n observed: …\\\" encoding=\\\"UTF-8\\\"?><AccessControlPolicy xmlns=\\\"http://s3.am…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-bkt-0026"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: single-region server rejects creating the foreign-region fixture bucket with status 400."
|
||||
failure = "[runner/fixture-refused] at /setup: external fixture PUT for bucket `conf-bkt-far` returned status 400; the failed create is not owned"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-bucketconfig-0030"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: GetBucketPolicyStatus on a bucket without a policy returns 200 instead of 404 NoSuchBucketPolicy."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 404, observed 200",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>NoSuchBucketPolicy</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-bucketconfig-0031"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: GetPublicAccessBlock on an unconfigured bucket returns 500 instead of 404 NoSuchPublicAccessBlockConfiguration."
|
||||
failure = "[expect/status] at /expect/status: exchange #1, attempt 1: expected status 404, observed 500"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0003"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: static external-endpoint server has no fixture STS session token and returns 403."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 403",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 16 bytes, observed 224 bytes)\n expected: credential-probe\n observed: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0008"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: unknown access key returns the standard S3 InvalidAccessKeyId error message instead of the redacted conformance text."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 86 (expected 201 bytes, observed 200 bytes)\n expected: …eyId</Code><Message>the request was not authenticated</Messa…\n observed: …eyId</Code><Message>The Access Key Id you provided does not …",
|
||||
"[expect/body.not_contains_utf8] at /expect/body: exchange #1, attempt 1: the body must not contain \"does not exist\", found at byte 117",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0009"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: wrong secret key returns the standard S3 SignatureDoesNotMatch error message instead of the redacted conformance text."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 89 (expected 204 bytes, observed 356 bytes)\n expected: …atch</Code><Message>the request was not authenticated</Messa…\n observed: …atch</Code><Message>The request signature we calculated does…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-cred-0010"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: unknown or disabled credential returns the standard S3 InvalidAccessKeyId error message instead of the redacted conformance text."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 86 (expected 201 bytes, observed 200 bytes)\n expected: …eyId</Code><Message>the request was not authenticated</Messa…\n observed: …eyId</Code><Message>The Access Key Id you provided does not …",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-encryption-0012"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: GetBucketEncryption on an unconfigured bucket returns 400 with hyphenated server-side wording instead of 404."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 404, observed 400",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 124 (expected 250 bytes, observed 222 bytes)\n expected: …><Message>The server side encryption configuration was not f…\n observed: …><Message>The server-side encryption configuration was not f…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-host-0006"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: virtual-host routing does not resolve this mid-domain Host header to path style and returns 404 XML."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 404",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: text/plain; charset=utf-8`, observed `application/xml`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 14 bytes, observed 192 bytes)\n expected: virtual hosted\n observed: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-host-0009"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: unrecognized multi-label Host prefix returns 404 XML instead of path-style 200."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 404",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: text/plain; charset=utf-8`, observed `application/xml`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 14 bytes, observed 192 bytes)\n expected: virtual hosted\n observed: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-host-0010"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: punycode Host bucket label is rejected with 400 XML instead of falling back to path style."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 400",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: text/plain; charset=utf-8`, observed `application/xml`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 14 bytes, observed 222 bytes)\n expected: virtual hosted\n observed: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-host-0011"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: illegal Host bucket label is rejected with 400 XML instead of falling back to path style."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 400",
|
||||
"[expect/headers_present] at /expect/headers_present/content-type: exchange #1, attempt 1: expected `content-type: text/plain; charset=utf-8`, observed `application/xml`",
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 0 (expected 14 bytes, observed 222 bytes)\n expected: virtual hosted\n observed: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-lifecycle-0013"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: NoSuchLifecycleConfiguration message includes a trailing period and omits HostId."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 138 (expected 220 bytes, observed 192 bytes)\n expected: …ation does not exist</Message><RequestId>__REDACTED__</Reque…\n observed: …ation does not exist.</Message><RequestId>__REDACTED__</Requ…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-location-0001"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: single-region server rejects creating the foreign-region fixture bucket with status 400."
|
||||
failure = "[runner/fixture-refused] at /setup: external fixture PUT for bucket `conf-location-far` returned status 400; the failed create is not owned"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-location-0005"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: GetBucketLocation accepts the request and returns 200 LocationConstraint instead of 400 AuthorizationHeaderMalformed."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 200",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>AuthorizationHeaderMalformed</Code>, the body carried no <Code> element at all",
|
||||
"[expect/error.request_id_present] at /expect/error/request_id_present: exchange #1, attempt 1: expected <RequestId> to be present and non-empty, it was absent",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>AuthorizationHeaderMalformed</Code>\"",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Region>us-east-1</Region>\"",
|
||||
"[expect/body.not_contains_utf8] at /expect/body: exchange #1, attempt 1: the body must not contain \"<LocationConstraint\", found at byte 38",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-lock-0011"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: ObjectLockConfigurationNotFoundError XML omits the HostId element."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 206 (expected 242 bytes, observed 213 bytes)\n expected: …ACTED__</RequestId><HostId>__REDACTED__</HostId></Error>\n observed: …ACTED__</RequestId></Error>",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-lock-0029"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: NoSuchBucket XML on GetObjectLockConfiguration omits the HostId element."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 161 (expected 197 bytes, observed 168 bytes)\n expected: …ACTED__</RequestId><HostId>__REDACTED__</HostId></Error>\n observed: …ACTED__</RequestId></Error>",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-naming-0033"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: escaped slash in the first path segment fails signature verification (403 SignatureDoesNotMatch) before bucket-name validation."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 403",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>InvalidBucketName</Code>, the body carried <Code>SignatureDoesNotMatch</Code>",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>InvalidBucketName</Code>\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-replication-0013"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: ReplicationConfigurationNotFoundError carries the legacy 'replication not found' message."
|
||||
failures = [
|
||||
"[expect/body.exact_utf8] at /expect/body: exchange #1, attempt 1: bodies differ at byte 105 (expected 230 bytes, observed 179 bytes)\n expected: …rror</Code><Message>The replication configuration was not fo…\n observed: …rror</Code><Message>replication not found</Message><RequestI…",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0506"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: SigV2 request using x-amz-date with an empty Date slot is rejected with 400."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 200, observed 400",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<ListAllMyBucketsResult\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0597"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: empty credential scope region returns SignatureDoesNotMatch for both header and presigned exchanges."
|
||||
failures = [
|
||||
"[expect/error.code] at /exchanges/0/expect/error/code: exchange #1 header, attempt 1: expected <Code>InvalidAccessKeyId</Code>, the body carried <Code>SignatureDoesNotMatch</Code>",
|
||||
"[expect/body.contains_utf8] at /exchanges/0/expect/body: exchange #1 header, attempt 1: the body does not contain \"<Code>InvalidAccessKeyId</Code>\"",
|
||||
"[expect/error.code] at /exchanges/1/expect/error/code: exchange #2 presigned, attempt 1: expected <Code>AccessDenied</Code>, the body carried <Code>SignatureDoesNotMatch</Code>",
|
||||
"[expect/body.contains_utf8] at /exchanges/1/expect/body: exchange #2 presigned, attempt 1: the body does not contain \"<Code>AccessDenied</Code>\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0599"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: out-of-grammar credential scope region returns 403 SignatureDoesNotMatch instead of 400 AuthorizationHeaderMalformed."
|
||||
failures = [
|
||||
"[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 403",
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>AuthorizationHeaderMalformed</Code>, the body carried <Code>SignatureDoesNotMatch</Code>",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>AuthorizationHeaderMalformed</Code>\"",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Region>us-east-1</Region>\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0600"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: overlong credential scope region returns SignatureDoesNotMatch instead of InvalidAccessKeyId."
|
||||
failures = [
|
||||
"[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>InvalidAccessKeyId</Code>, the body carried <Code>SignatureDoesNotMatch</Code>",
|
||||
"[expect/body.contains_utf8] at /expect/body: exchange #1, attempt 1: the body does not contain \"<Code>InvalidAccessKeyId</Code>\"",
|
||||
]
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0604"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: unsigned x-amz-* metadata header returns AccessDenied after credential lookup instead of SignatureDoesNotMatch."
|
||||
failure = "[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>SignatureDoesNotMatch</Code>, the body carried <Code>AccessDenied</Code>"
|
||||
expires = 2027-02-01
|
||||
|
||||
[[ruling]]
|
||||
case = "c-sig-0605"
|
||||
ledger = "rustfs/backlog#2684"
|
||||
reason = "Official 1.0.5 parity: presigned URL with unlisted payload declaration header returns AccessDenied instead of SignatureDoesNotMatch."
|
||||
failure = "[expect/error.code] at /expect/error/code: exchange #1, attempt 1: expected <Code>SignatureDoesNotMatch</Code>, the body carried <Code>AccessDenied</Code>"
|
||||
expires = 2027-02-01
|
||||
# Rulings for the gateway conformance lane (.github/workflows/gateway-acceptance.yml).
|
||||
#
|
||||
# One row per case that fails on the GATEWAY stack for a reviewed reason: `case`; `ledger`, the
|
||||
# rustfs/backlog#2684 entry that accepts the difference (R-0xx or K-n); a one-line `reason`; and
|
||||
# `failure`, a prefix of the failure the ruling accepts, as the runner's report.json renders it
|
||||
# (`[expect/status] at /expect/status: exchange #1, attempt 1: expected status 400, observed 403`).
|
||||
# scripts/check_conformance_rulings.py fails the lane on a failed case without a row, on a ruled
|
||||
# case whose failures do not start with its `failure`, and on a row whose case no longer fails or
|
||||
# no longer exists. The legacy stack is a reference run and takes no rulings: the `rustfs` profile
|
||||
# describes the gateway edge, not the legacy one.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
sha256-linux=983efba6508e684db29bbdb923485fcc1c4fb312fc47fe101f7f27620906978b
|
||||
sha256-darwin=983efba6508e684db29bbdb923485fcc1c4fb312fc47fe101f7f27620906978b
|
||||
sha256-linux=348fa5eed9ae58962c06b33283ff4f15122cff97bce9b4eb1e3ffcb227264b0b
|
||||
sha256-darwin=348fa5eed9ae58962c06b33283ff4f15122cff97bce9b4eb1e3ffcb227264b0b
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
sha256-darwin=107ad4762081d210db76cc622111c8664f69b29453bf5397d3575103badbc101
|
||||
sha256-linux=19762635332bbcc717a2d8af1541c23949e8381131b93466b4c39b995eccea14
|
||||
sha256-darwin=8fef326a3fddd8a548e2cbcc6ea8159f831113595fb003eeebbd9aeb4ac23e48
|
||||
sha256-linux=8b4381578377704ac8b1b5156128b83f036ec4aedc9d863fff25df15112420fc
|
||||
|
||||
@@ -1 +1 @@
|
||||
sha256=a88a5a77a1d038975bab9c66c77d113861721573978a99bb8df778811f4b4af7
|
||||
sha256=061d0a697967d2dc8f472ff885886e069b1cf4aeaa5f230e177b7236017c23b6
|
||||
|
||||
@@ -1,787 +0,0 @@
|
||||
# Ordinary S3 compatibility tests for gateway wire capture. The nightly run includes the smoke cases.
|
||||
|
||||
[smoke]
|
||||
e2e = [
|
||||
"listing_regression_test::tests::test_list_objects_v2_completeness_100_objects",
|
||||
"listing_regression_test::tests::test_list_objects_v2_delimiter_common_prefixes",
|
||||
"listing_regression_test::tests::test_list_objects_v2_is_truncated_correctness",
|
||||
"listing_regression_test::tests::test_list_objects_v2_prefix_filter_correctness",
|
||||
]
|
||||
ceph = [
|
||||
"test_bucket_listv2_prefix_basic",
|
||||
"test_bucket_listv2_continuationtoken",
|
||||
"test_object_head_zero_bytes",
|
||||
"test_object_write_file",
|
||||
"test_multipart_copy_small",
|
||||
"test_multipart_upload_resend_part",
|
||||
"test_multipart_upload_contents",
|
||||
]
|
||||
|
||||
[nightly_extra]
|
||||
e2e = [
|
||||
"anonymous_access_test::ghsa_x298_anonymous_list_object_versions_denied_when_restrict_public_buckets_enabled",
|
||||
"anonymous_access_test::test_anonymous_access_allowed_when_public_access_block_missing",
|
||||
"anonymous_access_test::test_anonymous_access_allowed_when_restrict_public_buckets_disabled",
|
||||
"anonymous_access_test::test_anonymous_access_denied_when_restrict_public_buckets_enabled",
|
||||
"anonymous_access_test::test_plain_http_matches_secure_transport_false_bucket_policy",
|
||||
"anonymous_access_test::test_root_requests_keep_policy_owner_flag",
|
||||
"api_rate_limit_test::api_rate_limit_bucket_dimension_throttles_per_bucket",
|
||||
"api_rate_limit_test::api_rate_limit_enforces_429_with_retry_after_when_enabled",
|
||||
"api_rate_limit_test::api_rate_limit_stays_inert_by_default",
|
||||
"archive_download_integrity_test::tests::test_archive_download_roundtrip_with_http_compression_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_multipart_roundtrip_preserves_bytes",
|
||||
"archive_download_integrity_test::tests::test_archive_multipart_with_aws_chunked_allowed_when_strict_mode_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_multipart_with_aws_chunked_and_effective_encoding_rejects_when_strict_mode_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_multipart_with_aws_chunked_and_effective_encoding_roundtrips_by_default",
|
||||
"archive_download_integrity_test::tests::test_archive_put_allows_content_encoding_by_default",
|
||||
"archive_download_integrity_test::tests::test_archive_put_rejects_content_encoding_when_strict_mode_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_put_with_aws_chunked_allowed_when_strict_mode_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_put_with_aws_chunked_and_effective_encoding_rejects_when_strict_mode_enabled",
|
||||
"archive_download_integrity_test::tests::test_archive_put_with_aws_chunked_and_effective_encoding_roundtrips_by_default",
|
||||
"archive_download_integrity_test::tests::test_archive_put_with_aws_chunked_does_not_persist_content_encoding_by_default",
|
||||
"archive_download_integrity_test::tests::test_multipart_get_ignores_empty_conditional_etag_headers",
|
||||
"archive_download_integrity_test::tests::test_presigned_get_and_reverse_proxy_preserve_multipart_bytes",
|
||||
"bucket_logging_test::tests::test_dummy_bucket_compatibility_endpoints",
|
||||
"bucket_logging_test::tests::test_dummy_bucket_compatibility_endpoints_no_such_bucket",
|
||||
"bucket_logging_test::tests::test_dummy_bucket_endpoints_http_contracts",
|
||||
"checksum_upload_test::tests::test_additional_checksums_verify_on_write",
|
||||
"checksum_upload_test::tests::test_complete_multipart_rejects_contradicting_checksum_type",
|
||||
"checksum_upload_test::tests::test_crc64nvme_matches_between_put_object_and_multipart_upload",
|
||||
"checksum_upload_test::tests::test_full_object_multipart_reports_full_object_checksum_type",
|
||||
"checksum_upload_test::tests::test_head_object_returns_sse_s3_checksum",
|
||||
"checksum_upload_test::tests::test_head_object_returns_stored_sha256",
|
||||
"checksum_upload_test::tests::test_multipart_upload_with_checksum",
|
||||
"checksum_upload_test::tests::test_put_object_rejects_mismatched_sha256",
|
||||
"checksum_upload_test::tests::test_put_object_with_checksum_sha256",
|
||||
"checksum_upload_test::tests::test_put_object_with_content_md5",
|
||||
"compression_test::test_compression_multipart_high_ratio_binary_roundtrip",
|
||||
"compression_test::test_compression_multipart_roundtrip",
|
||||
"compression_test::test_compression_multipart_sse_s3_roundtrip",
|
||||
"compression_test::test_compression_multipart_three_parts_part_number_gets",
|
||||
"compression_test::test_compression_multipart_upload_part_copy_roundtrip",
|
||||
"compression_test::test_compression_roundtrip",
|
||||
"conditional_delete_objects_test::sdk_conditional_delete_objects_mixed_results_overwrites_duplicates_and_quiet",
|
||||
"conditional_delete_objects_test::sdk_conditional_delete_objects_versioning_current_markers_and_explicit_versions",
|
||||
"content_encoding_test::tests::test_content_encoding_aws_chunked_not_returned_issue_1857",
|
||||
"content_encoding_test::tests::test_content_encoding_aws_chunked_with_effective_encoding_roundtrip",
|
||||
"content_encoding_test::tests::test_content_encoding_roundtrip",
|
||||
"copy_object_checksum_test::tests::test_copy_rejects_unknown_algorithm_without_destination_mutation",
|
||||
"copy_object_checksum_test::tests::test_copy_requested_algorithm_overrides_source_checksum",
|
||||
"copy_object_checksum_test::tests::test_copy_supports_all_checksum_algorithms",
|
||||
"copy_object_checksum_test::tests::test_copy_with_checksum_algorithm_returns_and_persists_sha256",
|
||||
"copy_object_checksum_test::tests::test_copy_without_algorithm_preserves_composite_checksum_type",
|
||||
"copy_object_checksum_test::tests::test_copy_without_algorithm_preserves_every_supported_source_checksum",
|
||||
"copy_object_checksum_test::tests::test_copy_without_algorithm_preserves_source_checksum",
|
||||
"copy_object_metadata_test::tests::copy_object_replace_accepts_each_standard_field_independently",
|
||||
"copy_object_metadata_test::tests::copy_object_replace_handles_versioned_multipart_source",
|
||||
"copy_object_metadata_test::tests::copy_object_standard_metadata_copy_replace_and_clear",
|
||||
"copy_object_metadata_test::tests::invalid_replacement_metadata_does_not_mutate_destination",
|
||||
"copy_object_tagging_test::tests::copy_object_applies_copy_replace_and_empty_tagging_directives",
|
||||
"copy_object_tagging_test::tests::copy_object_tag_replacement_honors_request_tag_policy_denial",
|
||||
"copy_object_version_restore_test::tests::test_copy_of_non_latest_source_version_returns_copy_source_version_id",
|
||||
"copy_object_version_restore_test::tests::test_self_copy_of_historical_version_restores_data_and_metadata",
|
||||
"copy_source_invalid_date_test::tests::test_copy_source_if_unmodified_since_valid_and_invalid",
|
||||
"create_bucket_region_test::tests::test_create_bucket_accepts_listed_regions",
|
||||
"create_bucket_region_test::tests::test_create_bucket_duplicate_in_default_region_is_idempotent_for_iam_user",
|
||||
"create_bucket_region_test::tests::test_create_bucket_duplicate_outside_default_region_reports_owned_by_you",
|
||||
"create_bucket_region_test::tests::test_create_bucket_location_constraint_policy_allow",
|
||||
"create_bucket_region_test::tests::test_create_bucket_location_constraint_policy_deny",
|
||||
"create_bucket_region_test::tests::test_create_bucket_rejects_unserved_location_constraints",
|
||||
"create_bucket_region_test::tests::test_create_bucket_uses_configured_region",
|
||||
"create_bucket_region_test::tests::test_create_bucket_with_us_east_1_location_constraint",
|
||||
"create_bucket_region_test::tests::test_create_bucket_without_location_constraint",
|
||||
"delete_marker_migration_semantics_test::tests::conditional_writes_cannot_replace_delete_marker_with_if_match",
|
||||
"delete_marker_migration_semantics_test::tests::test_versioning_delete_marker_plus_history_remains_visible_for_migration_proof",
|
||||
"delete_marker_migration_semantics_test::tests::test_versioning_only_delete_marker_has_minio_compatible_visibility_for_migration_proof",
|
||||
"delete_object_no_content_length_test::tests::test_delete_object_version_without_content_length_succeeds",
|
||||
"delete_objects_versioning_test::tests::test_delete_objects_delete_marker_immediately_visible",
|
||||
"delete_objects_versioning_test::tests::test_delete_objects_multiple_keys_delete_markers_immediately_visible",
|
||||
"delete_objects_versioning_test::tests::test_explicit_delete_marker_batch_removes_versions_without_client_retries",
|
||||
"delete_regression_test::tests::test_batch_delete_removes_all_objects",
|
||||
"delete_regression_test::tests::test_delete_removes_object_from_list",
|
||||
"delete_regression_test::tests::test_delete_removes_object_head_returns_404",
|
||||
"delete_regression_test::tests::test_versioned_delete_marker_and_list_consistency",
|
||||
"delete_regression_test::tests::test_versioned_permanent_delete",
|
||||
"dual_stack_differential::tests::both_stacks_answer_every_operation_identically",
|
||||
"get_object_parts_count_test::get_object_reports_parts_count_for_multipart_upload",
|
||||
"head_object_consistency_test::head_object_consistency_after_write_and_multipart_and_presigned_head",
|
||||
"head_object_range_test::head_object_advertises_accept_ranges",
|
||||
"kms::configured_roundtrip_test::test_admin_configured_local_kms_is_restored_after_restart",
|
||||
"kms::configured_roundtrip_test::test_configured_local_kms_admin_and_versioned_cleanup",
|
||||
"kms::copy_object_version_restore_sse_test::test_self_copy_of_historical_sse_s3_version_is_readable",
|
||||
"kms::encrypted_range_get_test::sse_s3_single_part_ranged_gets_are_byte_exact",
|
||||
"kms::kms_edge_cases_test::test_kms_single_byte_file_encryption",
|
||||
"kms::kms_edge_cases_test::test_kms_zero_byte_file_encryption",
|
||||
"kms::multipart_encryption_test::test_step1_basic_single_file_encryption",
|
||||
"leading_slash_key_test::tests::test_put_object_with_duplicate_slashes_normalized",
|
||||
"leading_slash_key_test::tests::test_put_object_with_leading_slash_key",
|
||||
"lifecycle_regression_test::tests::test_delete_marker_creation_and_visibility",
|
||||
"lifecycle_regression_test::tests::test_lifecycle_expiration_rule_persists_correctly",
|
||||
"lifecycle_regression_test::tests::test_lifecycle_noncurrent_version_expiration_rule_persists",
|
||||
"lifecycle_regression_test::tests::test_lifecycle_prefix_rule_persists",
|
||||
"list_buckets_auth_test::bucket_scoped_policy_returns_only_authorized_bucket",
|
||||
"list_buckets_double_slash_test::tests::test_double_slash_rewrite_is_narrowly_scoped",
|
||||
"list_buckets_double_slash_test::tests::test_list_buckets_double_slash_browser_compat",
|
||||
"list_buckets_double_slash_test::tests::test_list_buckets_single_slash",
|
||||
"list_buckets_iam_filter_test::list_buckets_filters_with_iam_bucket_resources",
|
||||
"list_object_versions_metadata_extension_test::tests::test_list_object_versions_metadata_extension_returns_metadata_tags_and_internal",
|
||||
"list_object_versions_regression_test::tests::test_list_object_versions_immediately_returns_latest_put_after_delete_marker",
|
||||
"list_object_versions_regression_test::tests::test_list_object_versions_prefix_with_marker_object_returns_children",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_exact_prefix_pagination_boundaries",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_object_and_same_named_prefix_coexist",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_prefix_marker_pagination",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_prefix_marker_preserves_metadata",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_unique_common_prefixes",
|
||||
"list_objects_duplicates_test::tests::test_list_objects_v2_unique_contents_with_explicit_directory_markers",
|
||||
"list_objects_v2_metadata_extension_test::tests::test_list_objects_v2_metadata_extension_returns_metadata_tags_and_internal",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_continuation_keeps_keys_after_marker_stem",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_delimiter_collapsed_prefix_no_false_truncation",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_delimiter_small_page_traverses_all",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_empty_bucket",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_max_keys_above_limit_returns_token",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_max_keys_equals_object_count",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_max_keys_zero",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_maxkeys_above_limit_with_delimiter",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_not_truncated_when_all_objects_returned",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_pagination_with_continuation_token",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_raw_exceeds_maxkeys_but_visible_below",
|
||||
"list_objects_v2_pagination_test::tests::test_list_objects_v2_repeated_prefix_continuation",
|
||||
"multipart_auth_test::test_anonymous_post_object_accepts_fields_covered_by_policy_conditions",
|
||||
"multipart_auth_test::test_anonymous_post_object_accepts_form_fields_covered_by_policy_conditions",
|
||||
"multipart_auth_test::test_anonymous_post_object_accepts_success_action_redirect_exact_policy_match",
|
||||
"multipart_auth_test::test_anonymous_post_object_defaults_to_no_content",
|
||||
"multipart_auth_test::test_anonymous_post_object_honors_success_action_redirect",
|
||||
"multipart_auth_test::test_anonymous_post_object_honors_success_action_status",
|
||||
"multipart_auth_test::test_signed_put_object_extract_accepts_compat_header",
|
||||
"multipart_auth_test::test_signed_put_object_extract_expands_s2_and_lz4_by_magic_with_raw_etags",
|
||||
"multipart_auth_test::test_signed_put_object_extract_expands_tar_entries_with_prefix_headers",
|
||||
"multipart_auth_test::test_signed_put_object_extract_expands_tar_gz_archive",
|
||||
"multipart_auth_test::test_signed_put_object_extract_expands_tbz2_archive",
|
||||
"multipart_auth_test::test_signed_put_object_extract_normalizes_prefix_header_value",
|
||||
"multipart_auth_test::test_signed_put_object_extract_pax_retention_overrides_request_retention",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_directory_markers_by_default",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_entry_mtime",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_object_lock_legal_hold",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_object_lock_retention",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_request_metadata_on_extracted_objects",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_sse_c",
|
||||
"multipart_auth_test::test_signed_put_object_extract_preserves_sse_s3_and_redirect",
|
||||
"multipart_copy_readiness_test::harbor_style_multipart_staging_copy_object_boundaries",
|
||||
"multipart_copy_readiness_test::multipart_complete_invalid_etag_returns_400_and_preserves_retry",
|
||||
"multipart_storage_class_test::tests::invalid_and_aborted_uploads_leave_no_session_or_object",
|
||||
"multipart_storage_class_test::tests::list_parts_sdk_paginator_terminates_and_preserves_completion",
|
||||
"multipart_storage_class_test::tests::multipart_copy_preserves_standard_and_rrs",
|
||||
"multipart_storage_class_test::tests::multipart_upload_preserves_standard_and_rrs_across_retry_and_resume",
|
||||
"multipart_upload_id_test::tests::aborted_upload_id_reports_no_such_upload_on_every_upload_operation",
|
||||
"multipart_upload_id_test::tests::malformed_upload_id_reports_no_such_upload_on_every_upload_operation",
|
||||
"negative_sigv4_test::aws_chunked_decoded_length_mismatch_returns_incomplete_body",
|
||||
"negative_sigv4_test::aws_chunked_named_errors_reject_put_and_upload_part",
|
||||
"negative_sigv4_test::aws_chunked_valid_signed_and_trailer_boundaries_succeed",
|
||||
"negative_sigv4_test::ghsa_xm99_header_sigv4_accepts_signed_copy_source",
|
||||
"negative_sigv4_test::ghsa_xm99_header_sigv4_rejects_unsigned_copy_source",
|
||||
"negative_sigv4_test::malformed_authorization_header_returns_clean_4xx",
|
||||
"negative_sigv4_test::skewed_date_returns_request_time_too_skewed",
|
||||
"negative_sigv4_test::snowball_streaming_unsigned_trailer_rejects_forged_signature",
|
||||
"negative_sigv4_test::snowball_streaming_unsigned_trailer_returns_sha256_checksum",
|
||||
"negative_sigv4_test::tampered_payload_is_rejected",
|
||||
"negative_sigv4_test::tampered_signature_returns_signature_does_not_match",
|
||||
"negative_sigv4_test::tampered_upload_part_payload_is_rejected",
|
||||
"negative_sigv4_test::valid_header_sigv4_request_succeeds",
|
||||
"negative_sigv4_test::wrong_secret_key_returns_signature_does_not_match",
|
||||
"notification_webhook_test::test_webhook_event_delivery_and_filtering",
|
||||
"notification_webhook_test::test_webhook_metadata_mutations_keep_verified_bucket_identity",
|
||||
"object_lock::object_lock_test::test_complete_multipart_upload_creates_new_version_under_compliance_retention",
|
||||
"object_lock::object_lock_test::test_complete_multipart_upload_creates_new_version_under_legal_hold",
|
||||
"object_lock::object_lock_test::test_copy_object_applies_requested_legal_hold",
|
||||
"object_lock::object_lock_test::test_copy_object_does_not_inherit_source_legal_hold",
|
||||
"object_lock::object_lock_test::test_copy_object_overwrite_creates_new_version_under_legal_hold",
|
||||
"object_lock::object_lock_test::test_copy_object_retention_uses_destination_policy",
|
||||
"object_lock::object_lock_test::test_create_multipart_upload_applies_requested_legal_hold",
|
||||
"object_lock::object_lock_test::test_create_multipart_upload_creates_new_version_under_compliance_retention",
|
||||
"object_lock::object_lock_test::test_default_retention_applied_to_new_objects",
|
||||
"object_lock::object_lock_test::test_delete_completed_multipart_object_blocked_by_legal_hold",
|
||||
"object_lock::object_lock_test::test_delete_completed_multipart_object_blocked_by_retention",
|
||||
"object_lock::object_lock_test::test_delete_object_after_legal_hold_removed",
|
||||
"object_lock::object_lock_test::test_delete_object_allowed_by_governance_with_bypass",
|
||||
"object_lock::object_lock_test::test_delete_object_allowed_with_legal_hold_off",
|
||||
"object_lock::object_lock_test::test_delete_object_blocked_by_compliance_retention",
|
||||
"object_lock::object_lock_test::test_delete_object_blocked_by_governance_without_bypass",
|
||||
"object_lock::object_lock_test::test_delete_object_blocked_by_legal_hold",
|
||||
"object_lock::object_lock_test::test_delete_object_creates_delete_marker_for_default_retained_current_version",
|
||||
"object_lock::object_lock_test::test_delete_object_creates_delete_marker_for_retained_current_version",
|
||||
"object_lock::object_lock_test::test_delete_objects_mixed_locked_unlocked",
|
||||
"object_lock::object_lock_test::test_get_object_legal_hold_returns_updated_status",
|
||||
"object_lock::object_lock_test::test_get_object_retention_returns_configured_values",
|
||||
"object_lock::object_lock_test::test_legal_hold_and_retention_delete_errors_are_exact_and_non_mutating",
|
||||
"object_lock::object_lock_test::test_multipart_default_retention_fixed_at_create",
|
||||
"object_lock::object_lock_test::test_put_copy_and_multipart_reject_incomplete_retention_headers",
|
||||
"object_lock::object_lock_test::test_put_object_overwrite_creates_new_version_under_legal_hold",
|
||||
"object_lock::object_lock_test::test_put_retention_compliance_can_extend",
|
||||
"object_lock::object_lock_test::test_put_retention_compliance_cannot_shorten",
|
||||
"object_lock::object_lock_test::test_put_retention_governance_extend_without_bypass",
|
||||
"object_lock::object_lock_test::test_put_retention_governance_shorten_requires_bypass",
|
||||
"object_lock::object_lock_test::test_unretained_object_lock_object_delete_and_bucket_cleanup",
|
||||
"object_lock::object_lock_test::test_versioning_auto_enabled_with_object_lock",
|
||||
"object_lock::object_lock_test::test_write_paths_require_put_object_legal_hold_permission",
|
||||
"object_lock::object_lock_test::test_write_paths_require_put_object_retention_permission",
|
||||
"on_demand_migration::get_basic_test::get_large_object_streams_through_and_backfills_in_background",
|
||||
"on_demand_migration::get_basic_test::get_with_version_id_does_not_consult_the_source",
|
||||
"on_demand_migration::get_basic_test::head_miss_answers_from_the_source_without_persisting",
|
||||
"on_demand_migration::interaction_test::test_odm_pull_emits_object_created_events_unless_disabled",
|
||||
"on_demand_migration::interaction_test::test_odm_pulled_object_inherits_object_lock_retention",
|
||||
"on_demand_migration::interaction_test::test_odm_pulled_object_replicates_and_target_as_source_is_rejected",
|
||||
"presigned_negative_test::expired_presigned_get_is_rejected",
|
||||
"presigned_negative_test::ghsa_g8w9_presigned_get_rejects_unsigned_x_amz_headers",
|
||||
"presigned_negative_test::ghsa_g8w9_presigned_put_accepts_signed_x_amz_headers",
|
||||
"presigned_negative_test::ghsa_g8w9_presigned_put_rejects_unsigned_copy_source",
|
||||
"presigned_negative_test::ghsa_g8w9_presigned_put_rejects_unsigned_x_amz_headers",
|
||||
"presigned_negative_test::ghsa_g8w9_presigned_put_still_accepts_unsigned_non_amz_headers",
|
||||
"presigned_negative_test::tampered_presigned_put_returns_signature_does_not_match",
|
||||
"presigned_negative_test::tampered_signature_returns_signature_does_not_match",
|
||||
"presigned_negative_test::tampered_target_key_returns_signature_does_not_match",
|
||||
"presigned_negative_test::valid_presigned_get_succeeds",
|
||||
"presigned_negative_test::valid_presigned_put_succeeds",
|
||||
"presigned_negative_test::wrong_secret_key_returns_signature_does_not_match",
|
||||
"put_object_no_content_length_test::tests::test_put_object_without_content_length_boundaries",
|
||||
"reliant::conditional_writes::test_conditional_multi_part_upload",
|
||||
"reliant::conditional_writes::test_conditional_put_failed",
|
||||
"reliant::conditional_writes::test_conditional_put_okay",
|
||||
"reliant::conditional_writes::test_conditional_put_when_object_does_not_exist",
|
||||
"reliant::lifecycle::test_lifecycle_expiry_backdated_mtime",
|
||||
"reliant::lifecycle::test_lifecycle_noncurrent_expiry_then_cleans_expired_delete_marker",
|
||||
"reliant::lifecycle::test_lifecycle_noncurrent_version_expiry_removes_only_old_version",
|
||||
"reliant::lifecycle::test_lifecycle_rejects_zero_day_rule",
|
||||
"reliant::lifecycle::test_lifecycle_versioned_current_version_expiry_creates_delete_marker",
|
||||
"reliant::s3_select_compression::test_select_object_content_compressed_csv_and_json",
|
||||
"reliant::s3_select_compression::test_select_object_content_compressed_disconnect_releases_query",
|
||||
"reliant::s3_select_compression::test_select_object_content_invalid_compressed_stream_fails",
|
||||
"reliant::sql::test_select_object_content_csv_aggregation",
|
||||
"reliant::sql::test_select_object_content_csv_basic",
|
||||
"reliant::sql::test_select_object_content_csv_limit",
|
||||
"reliant::sql::test_select_object_content_csv_order_by",
|
||||
"reliant::sql::test_select_object_content_error_handling",
|
||||
"reliant::sql::test_select_object_content_http_disconnect_releases_query",
|
||||
"reliant::sql::test_select_object_content_http_event_order_crc_and_input_byte_stats",
|
||||
"reliant::sql::test_select_object_content_json_basic",
|
||||
"reliant::sql::test_select_object_content_nested_json_source_path",
|
||||
"reliant::sql::test_select_object_content_nonexistent_object",
|
||||
"replication_lww_receiver_test::receiver_lww_keeps_newer_tags_across_delivery_orders",
|
||||
"sec_signature_matrix_test::ghsa_copy_source_authorization_enforced_both_stacks",
|
||||
"sec_signature_matrix_test::ghsa_sts_forged_or_wrong_secret_rejected_both_stacks",
|
||||
"sec_signature_matrix_test::ghsa_unknown_or_empty_secret_rejected_both_stacks",
|
||||
"sec_signature_matrix_test::ghsa_unsigned_amz_headers_rejected_both_stacks",
|
||||
"sec_signature_matrix_test::ghsa_versioned_get_requires_get_object_version_both_stacks",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_anonymous",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_head_error_body_empty",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_post_policy",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_sigv2_header",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_sigv2_presigned",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_sigv4_header",
|
||||
"sec_signature_matrix_test::sec_signature_matrix_sigv4_presigned",
|
||||
"security_boundary_test::test_excessive_multipart_parts",
|
||||
"security_boundary_test::test_large_xml_body_rejection",
|
||||
"select_request_root_alias_test::select_request_root_alias_reaches_select_endpoint",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_accepts_negative_gnu_mtime",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_applies_member_semantics_and_metadata_precedence",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_consumes_concatenated_gzip_members",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_ignores_directories_when_requested",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_ignores_invalid_entries_when_requested",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_prefers_exact_minio_prefix_over_suffix_fallback",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_rejects_corrupt_tar_when_ignore_errors_enabled",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_rejects_gzip_crc_error_when_ignore_errors_enabled",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_rejects_mismatched_content_md5",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_rejects_parent_dir_entry_even_when_ignore_errors_enabled",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_rejects_veeam_virtual_members",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_skips_non_utf8_member_without_lossy_key_collision",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_skips_non_utf8_symlink_without_ignore_errors",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_supports_minio_prefix_and_directory_markers",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_supports_standard_headers_with_combined_extract_options",
|
||||
"snowball_auto_extract_test::tests::snowball_auto_extract_validates_pax_version_id_against_bucket_state",
|
||||
"special_chars_test::tests::test_control_characters_rejected",
|
||||
"special_chars_test::tests::test_copy_object_with_special_chars",
|
||||
"special_chars_test::tests::test_delete_object_with_special_chars",
|
||||
"special_chars_test::tests::test_head_object_with_special_chars",
|
||||
"special_chars_test::tests::test_issue_scenario_exact",
|
||||
"special_chars_test::tests::test_list_with_delimiter_and_special_chars",
|
||||
"special_chars_test::tests::test_list_with_special_char_prefixes",
|
||||
"special_chars_test::tests::test_object_with_mixed_special_chars",
|
||||
"special_chars_test::tests::test_object_with_plus_in_path",
|
||||
"special_chars_test::tests::test_object_with_space_in_path",
|
||||
"special_chars_test::tests::test_signed_get_existing_object_with_trailing_equals_returns_content",
|
||||
"special_chars_test::tests::test_signed_get_missing_object_with_trailing_equals_returns_no_such_key",
|
||||
"special_chars_test::tests::test_special_chars_in_different_path_positions",
|
||||
"special_chars_test::tests::test_unicode_characters_in_path",
|
||||
"ssec_copy_test::copy_object_rotates_ssec_key_and_drops_source_encryption_metadata",
|
||||
"ssec_copy_test::multipart_copy_requires_keys_on_every_stage_and_abort_leaves_no_object",
|
||||
"storage_class_capability_test::tests::authenticated_runtime_capabilities_publish_the_versioned_storage_class_contract",
|
||||
"storage_class_capability_test::tests::historical_label_only_metadata_is_standard_without_hiding_a_real_transition_tier",
|
||||
"storage_class_capability_test::tests::label_only_aws_classes_fail_before_put_copy_or_multipart_mutation",
|
||||
"storage_class_capability_test::tests::standard_and_rrs_are_supported_across_put_copy_and_multipart",
|
||||
"version_id_regression_test::tests::test_basic_s3_operations_no_regression",
|
||||
"version_id_regression_test::tests::test_copy_object_omits_version_id_with_suspended_versioning",
|
||||
"version_id_regression_test::tests::test_copy_object_returns_version_id_with_versioning",
|
||||
"version_id_regression_test::tests::test_multipart_upload_omits_version_id_with_suspended_versioning",
|
||||
"version_id_regression_test::tests::test_multipart_upload_returns_version_id_with_versioning",
|
||||
"version_id_regression_test::tests::test_put_object_omits_version_id_with_suspended_versioning",
|
||||
"version_id_regression_test::tests::test_put_object_returns_version_id_with_versioning",
|
||||
"version_id_regression_test::tests::test_put_object_without_versioning",
|
||||
"version_id_regression_test::tests::test_terraform_put_after_delete",
|
||||
"version_id_regression_test::tests::test_veeam_backup_workflow_simulation",
|
||||
"version_id_regression_test::tests::test_veeam_sosapi_system_and_capacity",
|
||||
"website_hosting_test::website_host_serves_pages_without_changing_s3_reads",
|
||||
]
|
||||
ceph = [
|
||||
"test_100_continue_error_retry",
|
||||
"test_abort_multipart_upload",
|
||||
"test_abort_multipart_upload_not_found",
|
||||
"test_basic_key_count",
|
||||
"test_block_public_policy",
|
||||
"test_block_public_policy_with_principal",
|
||||
"test_block_public_restrict_public_buckets",
|
||||
"test_bucket_acl_canned_private_to_private",
|
||||
"test_bucket_create_delete",
|
||||
"test_bucket_create_exists",
|
||||
"test_bucket_create_naming_bad_ip",
|
||||
"test_bucket_create_naming_bad_short_one",
|
||||
"test_bucket_create_naming_bad_short_two",
|
||||
"test_bucket_create_naming_bad_starts_nonalpha",
|
||||
"test_bucket_create_naming_dns_dash_at_end",
|
||||
"test_bucket_create_naming_dns_dash_dot",
|
||||
"test_bucket_create_naming_dns_dot_dash",
|
||||
"test_bucket_create_naming_dns_dot_dot",
|
||||
"test_bucket_create_naming_dns_long",
|
||||
"test_bucket_create_naming_dns_underscore",
|
||||
"test_bucket_create_naming_good_contains_hyphen",
|
||||
"test_bucket_create_naming_good_contains_period",
|
||||
"test_bucket_create_naming_good_long_60",
|
||||
"test_bucket_create_naming_good_long_61",
|
||||
"test_bucket_create_naming_good_long_62",
|
||||
"test_bucket_create_naming_good_long_63",
|
||||
"test_bucket_create_special_key_names",
|
||||
"test_bucket_delete_nonempty",
|
||||
"test_bucket_delete_notexist",
|
||||
"test_bucket_head",
|
||||
"test_bucket_head_notexist",
|
||||
"test_bucket_list_delimiter_alt",
|
||||
"test_bucket_list_delimiter_basic",
|
||||
"test_bucket_list_delimiter_dot",
|
||||
"test_bucket_list_delimiter_empty",
|
||||
"test_bucket_list_delimiter_none",
|
||||
"test_bucket_list_delimiter_not_exist",
|
||||
"test_bucket_list_delimiter_not_skip_special",
|
||||
"test_bucket_list_delimiter_percentage",
|
||||
"test_bucket_list_delimiter_prefix",
|
||||
"test_bucket_list_delimiter_prefix_ends_with_delimiter",
|
||||
"test_bucket_list_delimiter_prefix_underscore",
|
||||
"test_bucket_list_delimiter_unreadable",
|
||||
"test_bucket_list_delimiter_whitespace",
|
||||
"test_bucket_list_distinct",
|
||||
"test_bucket_list_empty",
|
||||
"test_bucket_list_encoding_basic",
|
||||
"test_bucket_list_long_name",
|
||||
"test_bucket_list_many",
|
||||
"test_bucket_list_marker_after_list",
|
||||
"test_bucket_list_marker_empty",
|
||||
"test_bucket_list_marker_none",
|
||||
"test_bucket_list_marker_not_in_list",
|
||||
"test_bucket_list_marker_unreadable",
|
||||
"test_bucket_list_maxkeys_invalid",
|
||||
"test_bucket_list_maxkeys_none",
|
||||
"test_bucket_list_maxkeys_one",
|
||||
"test_bucket_list_maxkeys_zero",
|
||||
"test_bucket_list_objects_anonymous_fail",
|
||||
"test_bucket_list_prefix_alt",
|
||||
"test_bucket_list_prefix_basic",
|
||||
"test_bucket_list_prefix_delimiter_alt",
|
||||
"test_bucket_list_prefix_delimiter_basic",
|
||||
"test_bucket_list_prefix_delimiter_delimiter_not_exist",
|
||||
"test_bucket_list_prefix_delimiter_prefix_delimiter_not_exist",
|
||||
"test_bucket_list_prefix_delimiter_prefix_not_exist",
|
||||
"test_bucket_list_prefix_empty",
|
||||
"test_bucket_list_prefix_none",
|
||||
"test_bucket_list_prefix_not_exist",
|
||||
"test_bucket_list_prefix_unreadable",
|
||||
"test_bucket_list_special_prefix",
|
||||
"test_bucket_list_unordered",
|
||||
"test_bucket_listv2_both_continuationtoken_startafter",
|
||||
"test_bucket_listv2_continuationtoken_empty",
|
||||
"test_bucket_listv2_delimiter_alt",
|
||||
"test_bucket_listv2_delimiter_basic",
|
||||
"test_bucket_listv2_delimiter_dot",
|
||||
"test_bucket_listv2_delimiter_empty",
|
||||
"test_bucket_listv2_delimiter_none",
|
||||
"test_bucket_listv2_delimiter_not_exist",
|
||||
"test_bucket_listv2_delimiter_percentage",
|
||||
"test_bucket_listv2_delimiter_prefix",
|
||||
"test_bucket_listv2_delimiter_prefix_ends_with_delimiter",
|
||||
"test_bucket_listv2_delimiter_prefix_underscore",
|
||||
"test_bucket_listv2_delimiter_unreadable",
|
||||
"test_bucket_listv2_delimiter_whitespace",
|
||||
"test_bucket_listv2_encoding_basic",
|
||||
"test_bucket_listv2_fetchowner_defaultempty",
|
||||
"test_bucket_listv2_fetchowner_empty",
|
||||
"test_bucket_listv2_fetchowner_notempty",
|
||||
"test_bucket_listv2_many",
|
||||
"test_bucket_listv2_maxkeys_none",
|
||||
"test_bucket_listv2_maxkeys_one",
|
||||
"test_bucket_listv2_maxkeys_zero",
|
||||
"test_bucket_listv2_objects_anonymous_fail",
|
||||
"test_bucket_listv2_prefix_alt",
|
||||
"test_bucket_listv2_prefix_delimiter_alt",
|
||||
"test_bucket_listv2_prefix_delimiter_basic",
|
||||
"test_bucket_listv2_prefix_delimiter_delimiter_not_exist",
|
||||
"test_bucket_listv2_prefix_delimiter_prefix_delimiter_not_exist",
|
||||
"test_bucket_listv2_prefix_delimiter_prefix_not_exist",
|
||||
"test_bucket_listv2_prefix_empty",
|
||||
"test_bucket_listv2_prefix_none",
|
||||
"test_bucket_listv2_prefix_not_exist",
|
||||
"test_bucket_listv2_prefix_unreadable",
|
||||
"test_bucket_listv2_startafter_after_list",
|
||||
"test_bucket_listv2_startafter_not_in_list",
|
||||
"test_bucket_listv2_startafter_unreadable",
|
||||
"test_bucket_listv2_unordered",
|
||||
"test_bucket_notexist",
|
||||
"test_bucket_policy_allow_notprincipal",
|
||||
"test_bucket_recreate_not_overriding",
|
||||
"test_buckets_create_then_list",
|
||||
"test_buckets_list_ctime",
|
||||
"test_bucketv2_notexist",
|
||||
"test_copy_object_ifmatch_failed",
|
||||
"test_copy_object_ifmatch_good",
|
||||
"test_copy_object_ifnonematch_failed",
|
||||
"test_copy_object_ifnonematch_good",
|
||||
"test_cors_header_option",
|
||||
"test_cors_presigned_get_object",
|
||||
"test_cors_presigned_put_object",
|
||||
"test_cors_presigned_put_object_with_acl",
|
||||
"test_delete_bucket_encryption_s3",
|
||||
"test_encrypted_transfer_13b",
|
||||
"test_encrypted_transfer_1b",
|
||||
"test_encrypted_transfer_1kb",
|
||||
"test_encryption_key_no_sse_c",
|
||||
"test_encryption_sse_c_deny_algo_with_bucket_policy",
|
||||
"test_encryption_sse_c_enforced_with_bucket_policy",
|
||||
"test_encryption_sse_c_invalid_md5",
|
||||
"test_encryption_sse_c_method_head",
|
||||
"test_encryption_sse_c_multipart_bad_download",
|
||||
"test_encryption_sse_c_multipart_invalid_chunks_1",
|
||||
"test_encryption_sse_c_multipart_invalid_chunks_2",
|
||||
"test_encryption_sse_c_multipart_upload",
|
||||
"test_encryption_sse_c_no_key",
|
||||
"test_encryption_sse_c_no_md5",
|
||||
"test_encryption_sse_c_other_key",
|
||||
"test_encryption_sse_c_post_object_authenticated_request",
|
||||
"test_encryption_sse_c_present",
|
||||
"test_encryption_sse_c_unaligned_multipart_upload",
|
||||
"test_expected_bucket_owner",
|
||||
"test_get_bucket_encryption_s3",
|
||||
"test_get_bucket_policy_status",
|
||||
"test_get_checksum_object_attributes",
|
||||
"test_get_multipart_object_attributes",
|
||||
"test_get_nonpublicpolicy_acl_bucket_policy_status",
|
||||
"test_get_nonpublicpolicy_principal_bucket_policy_status",
|
||||
"test_get_obj_head_tagging",
|
||||
"test_get_obj_tagging",
|
||||
"test_get_object_attributes",
|
||||
"test_get_object_ifmatch_failed",
|
||||
"test_get_object_ifmatch_good",
|
||||
"test_get_object_ifmodifiedsince_failed",
|
||||
"test_get_object_ifmodifiedsince_good",
|
||||
"test_get_object_ifnonematch_failed",
|
||||
"test_get_object_ifnonematch_good",
|
||||
"test_get_object_ifunmodifiedsince_failed",
|
||||
"test_get_object_ifunmodifiedsince_good",
|
||||
"test_get_object_torrent",
|
||||
"test_get_paginated_multipart_object_attributes",
|
||||
"test_get_public_block_deny_bucket_policy",
|
||||
"test_get_publicpolicy_acl_bucket_policy_status",
|
||||
"test_get_single_multipart_object_attributes",
|
||||
"test_get_sse_c_encrypted_object_attributes",
|
||||
"test_get_undefined_public_block",
|
||||
"test_get_versioned_object_attributes",
|
||||
"test_lifecycle_delete",
|
||||
"test_lifecycle_expiration_days0",
|
||||
"test_lifecycle_expiration_header_and_tags_head",
|
||||
"test_lifecycle_expiration_header_head",
|
||||
"test_lifecycle_expiration_header_put",
|
||||
"test_lifecycle_expiration_header_tags_head",
|
||||
"test_lifecycle_get",
|
||||
"test_lifecycle_get_no_id",
|
||||
"test_lifecycle_id_too_long",
|
||||
"test_lifecycle_invalid_status",
|
||||
"test_lifecycle_same_id",
|
||||
"test_lifecycle_set",
|
||||
"test_lifecycle_set_date",
|
||||
"test_lifecycle_set_deletemarker",
|
||||
"test_lifecycle_set_empty_filter",
|
||||
"test_lifecycle_set_filter",
|
||||
"test_lifecycle_set_invalid_date",
|
||||
"test_lifecycle_set_multipart",
|
||||
"test_lifecycle_set_noncurrent",
|
||||
"test_lifecycle_transition_set_invalid_date",
|
||||
"test_list_buckets_bad_auth",
|
||||
"test_list_buckets_invalid_auth",
|
||||
"test_list_multipart_upload",
|
||||
"test_multi_object_delete",
|
||||
"test_multi_objectv2_delete",
|
||||
"test_multipart_checksum_sha256",
|
||||
"test_multipart_copy_improper_range",
|
||||
"test_multipart_copy_invalid_range",
|
||||
"test_multipart_copy_multiple_sizes",
|
||||
"test_multipart_copy_special_names",
|
||||
"test_multipart_copy_versioned",
|
||||
"test_multipart_copy_without_range",
|
||||
"test_multipart_resend_first_finishes_last",
|
||||
"test_multipart_upload_empty",
|
||||
"test_multipart_upload_incorrect_etag",
|
||||
"test_multipart_upload_missing_part",
|
||||
"test_multipart_upload_multiple_sizes",
|
||||
"test_multipart_upload_on_a_bucket_with_policy",
|
||||
"test_multipart_upload_overwrite_existing_object",
|
||||
"test_multipart_upload_size_too_small",
|
||||
"test_non_multipart_get_part",
|
||||
"test_non_multipart_sse_c_get_part",
|
||||
"test_object_anon_put",
|
||||
"test_object_checksum_crc64nvme",
|
||||
"test_object_checksum_sha256",
|
||||
"test_object_content_encoding_aws_chunked",
|
||||
"test_object_copy_bucket_not_found",
|
||||
"test_object_copy_diff_bucket",
|
||||
"test_object_copy_key_not_found",
|
||||
"test_object_copy_replacing_metadata",
|
||||
"test_object_copy_retaining_metadata",
|
||||
"test_object_copy_same_bucket",
|
||||
"test_object_copy_to_itself",
|
||||
"test_object_copy_to_itself_with_metadata",
|
||||
"test_object_copy_verify_contenttype",
|
||||
"test_object_copy_versioned_bucket",
|
||||
"test_object_copy_versioned_url_encoding",
|
||||
"test_object_copy_versioning_multipart_upload",
|
||||
"test_object_copy_zero_size",
|
||||
"test_object_delete_key_bucket_gone",
|
||||
"test_object_lock_changing_mode_from_compliance",
|
||||
"test_object_lock_changing_mode_from_governance_with_bypass",
|
||||
"test_object_lock_changing_mode_from_governance_without_bypass",
|
||||
"test_object_lock_delete_multipart_object_with_legal_hold_on",
|
||||
"test_object_lock_delete_multipart_object_with_retention",
|
||||
"test_object_lock_delete_object_with_legal_hold_off",
|
||||
"test_object_lock_delete_object_with_legal_hold_on",
|
||||
"test_object_lock_delete_object_with_retention",
|
||||
"test_object_lock_delete_object_with_retention_and_marker",
|
||||
"test_object_lock_get_legal_hold",
|
||||
"test_object_lock_get_legal_hold_invalid_bucket",
|
||||
"test_object_lock_get_obj_lock",
|
||||
"test_object_lock_get_obj_lock_invalid_bucket",
|
||||
"test_object_lock_get_obj_metadata",
|
||||
"test_object_lock_get_obj_retention",
|
||||
"test_object_lock_get_obj_retention_invalid_bucket",
|
||||
"test_object_lock_get_obj_retention_iso8601",
|
||||
"test_object_lock_multi_delete_object_with_retention",
|
||||
"test_object_lock_put_legal_hold",
|
||||
"test_object_lock_put_legal_hold_invalid_bucket",
|
||||
"test_object_lock_put_legal_hold_invalid_status",
|
||||
"test_object_lock_put_obj_lock",
|
||||
"test_object_lock_put_obj_lock_enable_after_create",
|
||||
"test_object_lock_put_obj_lock_invalid_bucket",
|
||||
"test_object_lock_put_obj_lock_invalid_days",
|
||||
"test_object_lock_put_obj_lock_invalid_mode",
|
||||
"test_object_lock_put_obj_lock_invalid_status",
|
||||
"test_object_lock_put_obj_lock_invalid_years",
|
||||
"test_object_lock_put_obj_lock_with_days_and_years",
|
||||
"test_object_lock_put_obj_retention",
|
||||
"test_object_lock_put_obj_retention_increase_period",
|
||||
"test_object_lock_put_obj_retention_invalid_bucket",
|
||||
"test_object_lock_put_obj_retention_invalid_mode",
|
||||
"test_object_lock_put_obj_retention_override_default_retention",
|
||||
"test_object_lock_put_obj_retention_shorten_period",
|
||||
"test_object_lock_put_obj_retention_shorten_period_bypass",
|
||||
"test_object_lock_put_obj_retention_versionid",
|
||||
"test_object_lock_suspend_versioning",
|
||||
"test_object_lock_uploading_obj",
|
||||
"test_object_metadata_replaced_on_put",
|
||||
"test_object_presigned_put_object_with_acl",
|
||||
"test_object_put_acl_mtime",
|
||||
"test_object_put_authenticated",
|
||||
"test_object_raw_authenticated",
|
||||
"test_object_raw_authenticated_bucket_acl",
|
||||
"test_object_raw_authenticated_bucket_gone",
|
||||
"test_object_raw_authenticated_object_acl",
|
||||
"test_object_raw_authenticated_object_gone",
|
||||
"test_object_raw_get_object_acl",
|
||||
"test_object_raw_get_x_amz_expires_not_expired",
|
||||
"test_object_raw_get_x_amz_expires_out_range_zero",
|
||||
"test_object_raw_response_headers",
|
||||
"test_object_read_not_exist",
|
||||
"test_object_set_get_metadata_none_to_empty",
|
||||
"test_object_set_get_metadata_none_to_good",
|
||||
"test_object_set_get_metadata_overwrite_to_empty",
|
||||
"test_object_write_cache_control",
|
||||
"test_object_write_check_etag",
|
||||
"test_object_write_expires",
|
||||
"test_object_write_read_update_read_delete",
|
||||
"test_object_write_to_nonexist_bucket",
|
||||
"test_post_object_authenticated_no_content_type",
|
||||
"test_post_object_authenticated_request",
|
||||
"test_post_object_authenticated_request_bad_access_key",
|
||||
"test_post_object_case_insensitive_condition_fields",
|
||||
"test_post_object_condition_is_case_sensitive",
|
||||
"test_post_object_empty_conditions",
|
||||
"test_post_object_escaped_field_values",
|
||||
"test_post_object_expired_policy",
|
||||
"test_post_object_expires_is_case_sensitive",
|
||||
"test_post_object_ignored_header",
|
||||
"test_post_object_invalid_access_key",
|
||||
"test_post_object_invalid_content_length_argument",
|
||||
"test_post_object_invalid_signature",
|
||||
"test_post_object_missing_conditions_list",
|
||||
"test_post_object_missing_content_length_argument",
|
||||
"test_post_object_missing_expires_condition",
|
||||
"test_post_object_missing_signature",
|
||||
"test_post_object_no_key_specified",
|
||||
"test_post_object_set_key_from_filename",
|
||||
"test_post_object_tags_authenticated_request",
|
||||
"test_post_object_upload_size_below_minimum",
|
||||
"test_post_object_upload_size_limit_exceeded",
|
||||
"test_post_object_upload_size_rgw_chunk_size_bug",
|
||||
"test_post_object_user_specified_header",
|
||||
"test_put_bucket_encryption_s3",
|
||||
"test_put_delete_tags",
|
||||
"test_put_excess_key_tags",
|
||||
"test_put_excess_tags",
|
||||
"test_put_excess_val_tags",
|
||||
"test_put_get_delete_public_block",
|
||||
"test_put_max_kvsize_tags",
|
||||
"test_put_max_tags",
|
||||
"test_put_modify_tags",
|
||||
"test_put_obj_enc_conflict_c_s3",
|
||||
"test_put_obj_with_tags",
|
||||
"test_put_object_ifmatch_failed",
|
||||
"test_put_object_ifmatch_good",
|
||||
"test_put_object_ifmatch_nonexisted_failed",
|
||||
"test_put_object_ifmatch_overwrite_existed_good",
|
||||
"test_put_object_ifnonmatch_nonexisted_good",
|
||||
"test_put_object_ifnonmatch_overwrite_existed_failed",
|
||||
"test_put_public_block",
|
||||
"test_ranged_request_empty_object",
|
||||
"test_ranged_request_invalid_range",
|
||||
"test_ranged_request_response_code",
|
||||
"test_ranged_request_return_trailing_bytes_response_code",
|
||||
"test_ranged_request_skip_leading_bytes_response_code",
|
||||
"test_rm_bucket_logging",
|
||||
"test_set_bucket_tagging",
|
||||
"test_set_cors",
|
||||
"test_set_get_del_bucket_policy",
|
||||
"test_set_multipart_tagging",
|
||||
"test_upload_part_copy_percent_encoded_key",
|
||||
"test_versioning_bucket_atomic_upload_return_version_id",
|
||||
"test_versioning_bucket_create_suspend",
|
||||
"test_versioning_bucket_multipart_upload_return_version_id",
|
||||
"test_versioning_copy_obj_version",
|
||||
"test_versioning_multi_object_delete",
|
||||
"test_versioning_multi_object_delete_with_marker",
|
||||
"test_versioning_multi_object_delete_with_marker_create",
|
||||
"test_versioning_obj_create_overwrite_multipart",
|
||||
"test_versioning_obj_create_read_remove",
|
||||
"test_versioning_obj_create_read_remove_head",
|
||||
"test_versioning_obj_create_versions_remove_all",
|
||||
"test_versioning_obj_create_versions_remove_special_names",
|
||||
"test_versioning_obj_list_marker",
|
||||
"test_versioning_obj_plain_null_version_overwrite",
|
||||
"test_versioning_obj_plain_null_version_overwrite_suspended",
|
||||
"test_versioning_obj_plain_null_version_removal",
|
||||
"test_versioning_obj_suspend_versions",
|
||||
"test_versioning_obj_suspended_copy",
|
||||
]
|
||||
|
||||
# Same-byte replay uses cases that do not feed a server-generated object version or upload ID into a later request.
|
||||
[wire_replay]
|
||||
ceph = [
|
||||
"test_bucket_list_delimiter_alt",
|
||||
"test_bucket_list_delimiter_basic",
|
||||
"test_bucket_list_delimiter_dot",
|
||||
"test_bucket_list_delimiter_empty",
|
||||
"test_bucket_list_delimiter_none",
|
||||
"test_bucket_list_delimiter_not_exist",
|
||||
"test_bucket_list_delimiter_percentage",
|
||||
"test_bucket_list_delimiter_prefix",
|
||||
"test_bucket_list_delimiter_prefix_ends_with_delimiter",
|
||||
"test_bucket_list_delimiter_prefix_underscore",
|
||||
"test_bucket_list_delimiter_whitespace",
|
||||
"test_bucket_list_distinct",
|
||||
"test_bucket_list_empty",
|
||||
"test_bucket_list_encoding_basic",
|
||||
"test_bucket_list_many",
|
||||
"test_bucket_list_maxkeys_none",
|
||||
"test_bucket_list_maxkeys_one",
|
||||
"test_bucket_list_maxkeys_zero",
|
||||
"test_bucket_list_prefix_alt",
|
||||
"test_bucket_list_prefix_basic",
|
||||
"test_bucket_list_prefix_delimiter_alt",
|
||||
"test_bucket_list_prefix_delimiter_basic",
|
||||
"test_bucket_list_prefix_delimiter_delimiter_not_exist",
|
||||
"test_bucket_list_prefix_delimiter_prefix_delimiter_not_exist",
|
||||
"test_bucket_list_prefix_delimiter_prefix_not_exist",
|
||||
"test_bucket_list_prefix_empty",
|
||||
"test_bucket_list_prefix_none",
|
||||
"test_bucket_list_prefix_not_exist",
|
||||
"test_bucket_listv2_continuationtoken",
|
||||
"test_bucket_listv2_delimiter_alt",
|
||||
"test_bucket_listv2_delimiter_basic",
|
||||
"test_bucket_listv2_delimiter_dot",
|
||||
"test_bucket_listv2_delimiter_empty",
|
||||
"test_bucket_listv2_delimiter_none",
|
||||
"test_bucket_listv2_delimiter_not_exist",
|
||||
"test_bucket_listv2_delimiter_percentage",
|
||||
"test_bucket_listv2_delimiter_prefix",
|
||||
"test_bucket_listv2_delimiter_prefix_ends_with_delimiter",
|
||||
"test_bucket_listv2_delimiter_prefix_underscore",
|
||||
"test_bucket_listv2_delimiter_whitespace",
|
||||
"test_bucket_listv2_encoding_basic",
|
||||
"test_bucket_listv2_many",
|
||||
"test_bucket_listv2_maxkeys_none",
|
||||
"test_bucket_listv2_maxkeys_one",
|
||||
"test_bucket_listv2_maxkeys_zero",
|
||||
"test_bucket_listv2_prefix_alt",
|
||||
"test_bucket_listv2_prefix_basic",
|
||||
"test_bucket_listv2_prefix_delimiter_alt",
|
||||
"test_bucket_listv2_prefix_delimiter_basic",
|
||||
"test_bucket_listv2_prefix_delimiter_delimiter_not_exist",
|
||||
"test_bucket_listv2_prefix_delimiter_prefix_delimiter_not_exist",
|
||||
"test_bucket_listv2_prefix_delimiter_prefix_not_exist",
|
||||
"test_bucket_listv2_prefix_empty",
|
||||
"test_bucket_listv2_prefix_none",
|
||||
"test_bucket_listv2_prefix_not_exist",
|
||||
"test_get_obj_head_tagging",
|
||||
"test_get_obj_tagging",
|
||||
"test_lifecycle_expiration_header_head",
|
||||
"test_object_checksum_crc64nvme",
|
||||
"test_object_content_encoding_aws_chunked",
|
||||
"test_object_copy_diff_bucket",
|
||||
"test_object_copy_replacing_metadata",
|
||||
"test_object_copy_retaining_metadata",
|
||||
"test_object_copy_same_bucket",
|
||||
"test_object_copy_to_itself_with_metadata",
|
||||
"test_object_copy_verify_contenttype",
|
||||
"test_object_copy_zero_size",
|
||||
"test_object_head_zero_bytes",
|
||||
"test_object_lock_get_obj_lock",
|
||||
"test_object_lock_put_obj_lock",
|
||||
"test_object_metadata_replaced_on_put",
|
||||
"test_object_read_not_exist",
|
||||
"test_object_set_get_metadata_none_to_empty",
|
||||
"test_object_set_get_metadata_none_to_good",
|
||||
"test_object_set_get_metadata_overwrite_to_empty",
|
||||
"test_object_write_cache_control",
|
||||
"test_object_write_check_etag",
|
||||
"test_object_write_file",
|
||||
"test_object_write_read_update_read_delete",
|
||||
"test_put_delete_tags",
|
||||
"test_ranged_request_empty_object",
|
||||
"test_ranged_request_response_code",
|
||||
"test_ranged_request_return_trailing_bytes_response_code",
|
||||
"test_ranged_request_skip_leading_bytes_response_code",
|
||||
"test_rm_bucket_logging",
|
||||
"test_set_bucket_tagging",
|
||||
"test_set_cors",
|
||||
"test_versioning_bucket_create_suspend",
|
||||
]
|
||||
@@ -69,7 +69,6 @@ body-cache-whitelist-check: ## Check the body-cache eligibility gate stays a fai
|
||||
s3s-footprint-check: ## Check the s3s dependency footprint ratchet stays frozen
|
||||
@echo "📦 Checking s3s footprint ratchet..."
|
||||
./scripts/check_s3s_footprint.sh
|
||||
./scripts/check_s3s_footprint.sh --mode allowlist
|
||||
|
||||
.PHONY: release-feature-boundary-check
|
||||
release-feature-boundary-check: ## Check no release-reachable feature enables a debug-only one
|
||||
|
||||
@@ -39,11 +39,9 @@ script-tests: ## Run shell script tests
|
||||
./scripts/test_entrypoint_directories.sh
|
||||
./scripts/test_internode_grpc_ab_bench.sh
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_internode_grpc_window.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_internode_rpc_timeout_boundary.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_internode_msgpack_peer_canary.py
|
||||
./scripts/test_internode_msgpack_peer_canary_runner.sh
|
||||
./scripts/test_object_batch_bench_enhanced.sh
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_inline_docker_lab.py
|
||||
./scripts/test_package_service_scripts.sh
|
||||
./scripts/test_hotpath_warp_ab_gate.sh
|
||||
./scripts/test_hotpath_warp_abba.sh
|
||||
@@ -103,12 +101,10 @@ script-tests: ## Run shell script tests
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_retain_validation_evidence.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_ci_timing_report.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_junit_diff.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_dual_stack.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_mint_stack_diff.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/check_conformance_rulings.py --self-test
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/compat_matrix_report.py --self-test
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/check_gateway_admin_census.py --self-test
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_gateway_corpus_capture.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/test_gateway_wire_replay.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/s3-tests/test_report_compat.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/s3-tests/test_runner_tools.py
|
||||
$(RUSTFS_PYTHON_BIN) ./scripts/s3-tests/test_api_coverage.py
|
||||
|
||||
+9
-22
@@ -141,9 +141,8 @@ setup = 'ecstore-large-stack'
|
||||
filter = '(package(rustfs) & test(/^(admin::handlers::replication::target_repair_tests::[a-z_]+|admin::handlers::plugin_attempt::v2_tests::delegation_v2_persists_and_vends_with_real_parent_intersection|admin::handlers::site_replication::tests::durable_iam_state_apply_iam_item_rejects_a_stale_recreate_after_a_replicated_delete|admin::service::federated_identity::tests::(binding_keeps_explicit_iam_mapping_strict|markerless_legacy_oidc_session_crosses_auth_and_iam_deletion_boundaries)|storage::scanner_dirty_journal::tests::(clear_callback_keeps_unknown_coverage_until_all_pending_work_is_confirmed|owned_journals_keep_peer_records_after_interleaved_writes_and_clear))$/)) | (package(rustfs-heal) & ((binary(heal_b5_versioned_regression_test) & test(/^serial_tests::(test_heal_unversioned_bucket_e2e|test_historical_null_recursive_heal_restores_physical_versions|test_recursive_deep_heal_reports_stale_delete_marker_repair)$/)) | (binary(usage_observation_read_repair_test) & test(=usage_observation_read_repair_survives_snapshot_cleanup)))) | (package(rustfs-test-utils) & test(=data_usage_snapshot_tests::data_usage_snapshot_recovery_wires_primary_backup_and_negative_cache))'
|
||||
setup = 'ecstore-base-stack'
|
||||
|
||||
# The multipart refusal fixture composes real-store setup, abort, quota and legal-hold futures.
|
||||
[[profile.default.scripts]]
|
||||
filter = 'package(rustfs-ecstore) | package(rustfs-s3select-api) | package(rustfs-scanner) | (package(rustfs) & test(/^(app::multipart_usecase::complete::tests::completion_absent_binding_refusal_order_baseline|app::multipart_usecase::complete::tests::concurrent_completions_share_durable_bucket_quota_reservations|app::object::delete::tests::compressed_delete_requests_update_observed_usage_without_releasing_quota_floor|app::object::internal_put::tests::internal_multipart_roundtrip_completes_and_abort_leaves_nothing|app::object::restore::tests::execute_restore_object_maps_failures_to_typed_s3_errors|storage::access_owned::tests::generation_guards::(delete_object_access_captures_authorized_bucket_incarnation|copy_operations_reject_recreated_source_bucket_after_authorization|request_slot_keeps_bucket_policy_bound_to_its_store))$/))'
|
||||
filter = 'package(rustfs-ecstore) | package(rustfs-s3select-api) | package(rustfs-scanner) | (package(rustfs) & test(/^(app::multipart_usecase::complete::tests::concurrent_completions_share_durable_bucket_quota_reservations|app::object::delete::tests::compressed_delete_requests_update_observed_usage_without_releasing_quota_floor|app::object::internal_put::tests::internal_multipart_roundtrip_completes_and_abort_leaves_nothing|app::object::restore::tests::execute_restore_object_maps_failures_to_typed_s3_errors|storage::access::tests::(delete_object_access_captures_authorized_bucket_incarnation|copy_operations_reject_recreated_source_bucket_after_authorization|request_slot_keeps_bucket_policy_bound_to_its_store))$/))'
|
||||
setup = 'ecstore-base-stack'
|
||||
|
||||
# These handler/store fixtures and the relocated-pool GET compose deep storage
|
||||
@@ -253,7 +252,7 @@ threads-required = "num-test-threads"
|
||||
# peers complete durable IO. Reserve capacity from unrelated test processes;
|
||||
# the shared fixture's durable_iam_state_ prefix keeps the whole family together.
|
||||
[[profile.default.overrides]]
|
||||
filter = 'package(rustfs) & test(/^admin::handlers::site_replication::(tests::durable_iam_state_|removal_tests::decommission_durable_)/)'
|
||||
filter = 'package(rustfs) & test(/^admin::handlers::site_replication::tests::durable_iam_state_/)'
|
||||
threads-required = "num-test-threads"
|
||||
|
||||
# Real target-repair and rebalance-stop fixtures commit durable metadata while
|
||||
@@ -466,7 +465,7 @@ filter = '(package(rustfs) & test(/^(admin::handlers::replication::target_repair
|
||||
setup = 'ecstore-base-stack'
|
||||
|
||||
[[profile.ci.scripts]]
|
||||
filter = 'package(rustfs-ecstore) | package(rustfs-s3select-api) | package(rustfs-scanner) | (package(rustfs) & test(/^(app::multipart_usecase::complete::tests::completion_absent_binding_refusal_order_baseline|app::multipart_usecase::complete::tests::concurrent_completions_share_durable_bucket_quota_reservations|app::object::delete::tests::compressed_delete_requests_update_observed_usage_without_releasing_quota_floor|app::object::internal_put::tests::internal_multipart_roundtrip_completes_and_abort_leaves_nothing|app::object::restore::tests::execute_restore_object_maps_failures_to_typed_s3_errors|storage::access_owned::tests::generation_guards::(delete_object_access_captures_authorized_bucket_incarnation|copy_operations_reject_recreated_source_bucket_after_authorization|request_slot_keeps_bucket_policy_bound_to_its_store))$/))'
|
||||
filter = 'package(rustfs-ecstore) | package(rustfs-s3select-api) | package(rustfs-scanner) | (package(rustfs) & test(/^(app::multipart_usecase::complete::tests::concurrent_completions_share_durable_bucket_quota_reservations|app::object::delete::tests::compressed_delete_requests_update_observed_usage_without_releasing_quota_floor|app::object::internal_put::tests::internal_multipart_roundtrip_completes_and_abort_leaves_nothing|app::object::restore::tests::execute_restore_object_maps_failures_to_typed_s3_errors|storage::access::tests::(delete_object_access_captures_authorized_bucket_incarnation|copy_operations_reject_recreated_source_bucket_after_authorization|request_slot_keeps_bucket_policy_bound_to_its_store))$/))'
|
||||
setup = 'ecstore-base-stack'
|
||||
|
||||
[[profile.ci.scripts]]
|
||||
@@ -582,7 +581,7 @@ threads-required = "num-test-threads"
|
||||
# Keep the same IAM/state fixture capacity reservation in CI without changing the
|
||||
# production lock deadline, internal concurrency, assertions, or retry policy.
|
||||
[[profile.ci.overrides]]
|
||||
filter = 'package(rustfs) & test(/^admin::handlers::site_replication::(tests::durable_iam_state_|removal_tests::decommission_durable_)/)'
|
||||
filter = 'package(rustfs) & test(/^admin::handlers::site_replication::tests::durable_iam_state_/)'
|
||||
threads-required = "num-test-threads"
|
||||
|
||||
# Match the real admin fixture capacity reservation without retries or changes
|
||||
@@ -723,15 +722,16 @@ test-group = 'ecstore-serial-flaky'
|
||||
# fixture as the existing smoke modules.
|
||||
#
|
||||
# Dual-stack differential (rustfs/backlog#2740): `dual_stack_differential::`
|
||||
# starts two single-node servers on random ports with isolated temp
|
||||
# dirs, and runs one SDK script covering every S3 operation against both. Its
|
||||
# starts two single-node servers from the same binary, one per
|
||||
# RUSTFS_S3_STACK value, on random ports with isolated temp dirs, and runs one
|
||||
# SDK script covering every operation of `impl S3 for FS` against both. Its
|
||||
# comparator unit tests need no server. It meets the admission criteria
|
||||
# unchanged; the module clause admits a new differential test without another
|
||||
# filter edit.
|
||||
[profile.e2e-smoke]
|
||||
default-filter = """
|
||||
package(e2e_test) & (
|
||||
test(/^(access_request_validation|delete_marker_migration_semantics|version_id_regression|list_objects_v2_pagination|list_object_versions_regression|list_objects_duplicates|list_buckets_double_slash|list_buckets_auth|list_buckets_iam_filter|leading_slash_key|special_chars|create_bucket_region|delete_objects_versioning|head_object_consistency|head_object_range|copy_object_metadata|copy_object_tagging|copy_source_invalid_date|content_encoding|compression|multipart_storage_class|multipart_upload_id|storage_class_capability|ssec_copy|anonymous_access|bucket_policy_check|presigned_negative|negative_sigv4|admin_auth|notification_webhook|tls_hot_reload|console_smoke|admin_iam_crud|admin_pools|sts_query_compat|data_usage)_test::|^fake_s3_target::/)
|
||||
test(/^(delete_marker_migration_semantics|version_id_regression|list_objects_v2_pagination|list_object_versions_regression|list_objects_duplicates|list_buckets_double_slash|list_buckets_auth|list_buckets_iam_filter|leading_slash_key|special_chars|create_bucket_region|delete_objects_versioning|head_object_consistency|head_object_range|copy_object_metadata|copy_object_tagging|copy_source_invalid_date|content_encoding|compression|multipart_storage_class|multipart_upload_id|storage_class_capability|ssec_copy|anonymous_access|bucket_policy_check|presigned_negative|negative_sigv4|admin_auth|notification_webhook|tls_hot_reload|console_smoke|admin_iam_crud|admin_pools|sts_query_compat|data_usage)_test::|^fake_s3_target::/)
|
||||
| test(/^replication_extension_test::(test_replication_check_succeeds_with_remote_target|test_replication_check_rejects_target_without_object_lock|test_set_remote_target_rejects_unversioned_source_bucket|test_replication_check_rejects_unversioned_source_bucket|test_replication_check_rejects_missing_replication_config|test_replication_check_rejects_invalid_bucket|test_set_remote_target_rejects_same_bucket_on_same_deployment|test_set_remote_target_rejects_unversioned_target_bucket|test_set_remote_target_update_requires_arn|test_set_remote_target_update_rejects_missing_target|test_set_remote_target_rejects_invalid_target_url|test_set_remote_target_rejects_self_signed_https_target_without_skip_tls_verify|test_set_remote_target_rejects_private_ca_https_target_without_ca_cert_pem|test_list_remote_targets_rejects_empty_bucket|test_list_remote_targets_rejects_invalid_bucket|test_remove_remote_target_rejects_missing_target|test_remove_remote_target_rejects_missing_arn|test_remove_remote_target_rejects_invalid_bucket|test_remove_remote_target_rejects_target_used_by_replication|test_delete_bucket_replication_removes_remote_target)$/)
|
||||
| test(/^reliant::lifecycle::/)
|
||||
| test(/^conditional_delete_objects_test::/)
|
||||
@@ -960,11 +960,10 @@ path = "junit.xml"
|
||||
# differential picks side A (shell-script stand-ins, no server, no reference
|
||||
# binary). They already run on every pull request in e2e-smoke, so e2e-full
|
||||
# excludes them to keep its selection digest unchanged.
|
||||
# ACL admission protocol tests already run on every PR in e2e-smoke.
|
||||
[profile.e2e-full]
|
||||
default-filter = """
|
||||
package(e2e_test)
|
||||
& !test(/^(protocols|access_request_validation_test)::/)
|
||||
& !test(/^protocols::/)
|
||||
& !test(/^(admin_timeout_regression_test|cluster_concurrency_test|cluster_multidrive_pool_test|degraded_listing_availability_test|namespace_lock_quorum_test|object_lambda_test|stale_multipart_cleanup_cluster_test)::/)
|
||||
& !test(/^distributed::/)
|
||||
& !test(/^replication_extension_test::/)
|
||||
@@ -997,18 +996,6 @@ test-group = 'e2e-inline-boundaries'
|
||||
filter = 'package(e2e_test) & test(/^heal_erasure_disk_rebuild_test::/)'
|
||||
test-group = 'e2e-cluster-nightly'
|
||||
|
||||
# macOS can exceed the capability timeout when both startup CAS fixtures first
|
||||
# execute their private copies of the debug server at the same time.
|
||||
[[profile.e2e-full.overrides]]
|
||||
platform = { host = 'cfg(target_os = "macos")' }
|
||||
filter = """
|
||||
package(e2e_test) & (
|
||||
test(=distributed_startup_regression_test::tests::test_fresh_four_node_bootstrap_metadata_cas)
|
||||
| test(=distributed_startup_regression_test::tests::test_two_pool_restart_repairs_missing_pool_metadata_via_bootstrap_cas)
|
||||
)
|
||||
"""
|
||||
test-group = 'e2e-cluster-nightly'
|
||||
|
||||
# The multi-pool crash fixture seeds three nodes and 36 drives. Reserve this
|
||||
# nextest run's workers so other multi-node tests do not starve its deadline.
|
||||
[[profile.e2e-full.overrides]]
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# Adding a target is one more [[targets]] table, for example:
|
||||
#
|
||||
# [[targets]]
|
||||
# name = "candidate-tuned"
|
||||
# name = "candidate-gateway"
|
||||
# binary = "candidate"
|
||||
# env = { RUSTFS_EXAMPLE_SETTING = "on" }
|
||||
# env = { RUSTFS_S3_STACK = "gateway" }
|
||||
|
||||
schema = 1
|
||||
|
||||
|
||||
@@ -114,14 +114,8 @@
|
||||
}
|
||||
],
|
||||
"upgrade_sources": {
|
||||
"basis": "The three previous-release sources pinned in .github/workflows/e2e-upgrade.yml are exercised today (source.version / source.asset / source.sha256). No other N-1/N-2 compatibility is claimed, and these digests are not inferred from tags.",
|
||||
"basis": "Exactly the two previous-release sources pinned in .github/workflows/e2e-upgrade.yml are exercised today (source.version / source.asset / source.sha256). No other N-1/N-2 compatibility is claimed, and these digests are not inferred from tags.",
|
||||
"sources": [
|
||||
{
|
||||
"version": "1.0.5",
|
||||
"role": "gateway compatibility baseline",
|
||||
"artifact_name": "rustfs-linux-x86_64-gnu-v1.0.5.zip",
|
||||
"artifact_sha256": "5addae2f74756bf80104d0975e6347cda843bc2daffdfcd1f0cb80118b95cbd0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.1",
|
||||
"role": "N-1",
|
||||
@@ -136,6 +130,6 @@
|
||||
}
|
||||
],
|
||||
"rollback_supported": false,
|
||||
"rollback_basis": "The release upgrade lane checks bucket-config rollback. The hosted compatibility workflow also checks in-flight multipart rollback to 1.0.5. Full data-plane rollback is not certified and is never a default claim."
|
||||
"rollback_basis": "Only the bucket-config-rollback case (rollback_to_previous_release_reads_current_bucket_metadata) is exercised. Full data-plane rollback is not certified and is never a default claim."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,21 @@
|
||||
# entirely, and the script rejects such an entry. Only the s3s-facing edge of
|
||||
# the rustfs binary and the e2e oracle keep it.
|
||||
|
||||
# rustfs binary: reviewed #[cfg(test)] legacy comparison oracles
|
||||
# rustfs binary: the s3s-facing edge that survives Phase 1
|
||||
rustfs/src/storage/ecfs.rs
|
||||
rustfs/src/storage/s3_compat/**
|
||||
rustfs/src/storage/access.rs
|
||||
rustfs/src/auth.rs
|
||||
rustfs/src/error.rs
|
||||
rustfs/src/storage_api.rs
|
||||
rustfs/src/app/storage_api.rs
|
||||
rustfs/src/admin/router.rs
|
||||
rustfs/src/app/metadata_route.rs
|
||||
rustfs/src/server/http.rs
|
||||
rustfs/src/server/layer.rs
|
||||
rustfs/src/server/hybrid.rs
|
||||
rustfs/src/protocols/client.rs
|
||||
|
||||
# e2e oracle: reviewed test targets that compare S3 behaviour against s3s
|
||||
crates/e2e_test/src/access_request_validation_test.rs
|
||||
crates/e2e_test/src/dual_stack_differential/compare.rs
|
||||
# e2e oracle: the test target that verifies S3 behaviour against s3s
|
||||
crates/e2e_test/src/fake_s3_target/**
|
||||
crates/e2e_test/src/**
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
# s3_error_lines lines holding s3_error!, same scope, minus those the script
|
||||
# header's rule clears (rustfs_s3_types's macro); fails closed
|
||||
# ecstore_files Rust files referencing s3s paths under crates/ecstore/src
|
||||
files=3
|
||||
s3_error_lines=16
|
||||
files=63
|
||||
s3_error_lines=209
|
||||
ecstore_files=0
|
||||
|
||||
@@ -22,7 +22,7 @@ rustfs-connect-symbol-catalog 6 0
|
||||
rustfs-credentials 24 0
|
||||
rustfs-crypto 67 0
|
||||
rustfs-data-usage 58 0
|
||||
rustfs-ecstore 7858 3
|
||||
rustfs-ecstore 7858 2
|
||||
rustfs-extension-schema 23 0
|
||||
rustfs-filemeta 361 0
|
||||
rustfs-gateway-adapter 74 0
|
||||
@@ -57,7 +57,6 @@ rustfs-scanner 1392 20
|
||||
rustfs-scanner-metrics 90 0
|
||||
rustfs-security-governance 20 0
|
||||
rustfs-signer 34 0
|
||||
rustfs-sse 145 0
|
||||
rustfs-storage-api 34 0
|
||||
rustfs-targets 612 26
|
||||
rustfs-test-utils 1 0
|
||||
|
||||
@@ -35,7 +35,6 @@ services:
|
||||
- RUSTFS_LOCK_ACQUIRE_TIMEOUT=${RUSTFS_LOCK_ACQUIRE_TIMEOUT:-5}
|
||||
- RUSTFS_UNSAFE_BYPASS_DISK_CHECK=${RUSTFS_UNSAFE_BYPASS_DISK_CHECK:-true}
|
||||
- RUSTFS_DURABILITY_MODE=${RUSTFS_DURABILITY_MODE:-strict}
|
||||
- RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE=${RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS:-0}
|
||||
# Internode gRPC optimization knobs (grpc-optimization P0-P3). Defaults match the binary
|
||||
@@ -47,8 +46,6 @@ services:
|
||||
- RUSTFS_INTERNODE_CHANNEL_ISOLATION=${RUSTFS_INTERNODE_CHANNEL_ISOLATION:-false}
|
||||
- RUSTFS_INTERNODE_BULK_CHANNELS=${RUSTFS_INTERNODE_BULK_CHANNELS:-2}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY:-false}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED:-false}
|
||||
- RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED=${RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED:-false}
|
||||
- RUSTFS_INTERNODE_PREWARM=${RUSTFS_INTERNODE_PREWARM:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_BYPASS=${RUSTFS_INTERNODE_OFFLINE_BYPASS:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS=${RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS:-5}
|
||||
@@ -62,7 +59,7 @@ services:
|
||||
- node1_data_2:/data/rustfs2
|
||||
- node1_data_3:/data/rustfs3
|
||||
ports:
|
||||
- "${RUSTFS_NODE1_PORT:-9000}:9000"
|
||||
- "9000:9000"
|
||||
networks:
|
||||
- rustfs-cluster-net
|
||||
|
||||
@@ -88,7 +85,6 @@ services:
|
||||
- RUSTFS_LOCK_ACQUIRE_TIMEOUT=${RUSTFS_LOCK_ACQUIRE_TIMEOUT:-5}
|
||||
- RUSTFS_UNSAFE_BYPASS_DISK_CHECK=${RUSTFS_UNSAFE_BYPASS_DISK_CHECK:-true}
|
||||
- RUSTFS_DURABILITY_MODE=${RUSTFS_DURABILITY_MODE:-strict}
|
||||
- RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE=${RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS:-0}
|
||||
# Internode gRPC optimization knobs (grpc-optimization P0-P3). Defaults match the binary
|
||||
@@ -100,8 +96,6 @@ services:
|
||||
- RUSTFS_INTERNODE_CHANNEL_ISOLATION=${RUSTFS_INTERNODE_CHANNEL_ISOLATION:-false}
|
||||
- RUSTFS_INTERNODE_BULK_CHANNELS=${RUSTFS_INTERNODE_BULK_CHANNELS:-2}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY:-false}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED:-false}
|
||||
- RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED=${RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED:-false}
|
||||
- RUSTFS_INTERNODE_PREWARM=${RUSTFS_INTERNODE_PREWARM:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_BYPASS=${RUSTFS_INTERNODE_OFFLINE_BYPASS:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS=${RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS:-5}
|
||||
@@ -115,7 +109,7 @@ services:
|
||||
- node2_data_2:/data/rustfs2
|
||||
- node2_data_3:/data/rustfs3
|
||||
ports:
|
||||
- "${RUSTFS_NODE2_PORT:-9001}:9000"
|
||||
- "9001:9000"
|
||||
networks:
|
||||
- rustfs-cluster-net
|
||||
|
||||
@@ -141,7 +135,6 @@ services:
|
||||
- RUSTFS_LOCK_ACQUIRE_TIMEOUT=${RUSTFS_LOCK_ACQUIRE_TIMEOUT:-5}
|
||||
- RUSTFS_UNSAFE_BYPASS_DISK_CHECK=${RUSTFS_UNSAFE_BYPASS_DISK_CHECK:-true}
|
||||
- RUSTFS_DURABILITY_MODE=${RUSTFS_DURABILITY_MODE:-strict}
|
||||
- RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE=${RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS:-0}
|
||||
# Internode gRPC optimization knobs (grpc-optimization P0-P3). Defaults match the binary
|
||||
@@ -153,8 +146,6 @@ services:
|
||||
- RUSTFS_INTERNODE_CHANNEL_ISOLATION=${RUSTFS_INTERNODE_CHANNEL_ISOLATION:-false}
|
||||
- RUSTFS_INTERNODE_BULK_CHANNELS=${RUSTFS_INTERNODE_BULK_CHANNELS:-2}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY:-false}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED:-false}
|
||||
- RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED=${RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED:-false}
|
||||
- RUSTFS_INTERNODE_PREWARM=${RUSTFS_INTERNODE_PREWARM:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_BYPASS=${RUSTFS_INTERNODE_OFFLINE_BYPASS:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS=${RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS:-5}
|
||||
@@ -168,7 +159,7 @@ services:
|
||||
- node3_data_2:/data/rustfs2
|
||||
- node3_data_3:/data/rustfs3
|
||||
ports:
|
||||
- "${RUSTFS_NODE3_PORT:-9002}:9000"
|
||||
- "9002:9000"
|
||||
networks:
|
||||
- rustfs-cluster-net
|
||||
|
||||
@@ -194,7 +185,6 @@ services:
|
||||
- RUSTFS_LOCK_ACQUIRE_TIMEOUT=${RUSTFS_LOCK_ACQUIRE_TIMEOUT:-5}
|
||||
- RUSTFS_UNSAFE_BYPASS_DISK_CHECK=${RUSTFS_UNSAFE_BYPASS_DISK_CHECK:-true}
|
||||
- RUSTFS_DURABILITY_MODE=${RUSTFS_DURABILITY_MODE:-strict}
|
||||
- RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE=${RUSTFS_OBJECT_DIRECT_IO_WRITE_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_ENABLE:-false}
|
||||
- RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS=${RUSTFS_EXPERIMENTAL_FILE_FDATASYNC_GROUP_COMMIT_WAIT_MICROS:-0}
|
||||
# Internode gRPC optimization knobs (grpc-optimization P0-P3). Defaults match the binary
|
||||
@@ -206,8 +196,6 @@ services:
|
||||
- RUSTFS_INTERNODE_CHANNEL_ISOLATION=${RUSTFS_INTERNODE_CHANNEL_ISOLATION:-false}
|
||||
- RUSTFS_INTERNODE_BULK_CHANNELS=${RUSTFS_INTERNODE_BULK_CHANNELS:-2}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY:-false}
|
||||
- RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=${RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED:-false}
|
||||
- RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED=${RUSTFS_OBS_PUT_STAGE_METRICS_ENABLED:-false}
|
||||
- RUSTFS_INTERNODE_PREWARM=${RUSTFS_INTERNODE_PREWARM:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_BYPASS=${RUSTFS_INTERNODE_OFFLINE_BYPASS:-false}
|
||||
- RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS=${RUSTFS_INTERNODE_OFFLINE_REPROBE_SECS:-5}
|
||||
@@ -221,7 +209,7 @@ services:
|
||||
- node4_data_2:/data/rustfs2
|
||||
- node4_data_3:/data/rustfs3
|
||||
ports:
|
||||
- "${RUSTFS_NODE4_PORT:-9003}:9000"
|
||||
- "9003:9000"
|
||||
networks:
|
||||
- rustfs-cluster-net
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# syntax=docker/dockerfile:1.6
|
||||
# Copyright 2024 RustFS Team
|
||||
#
|
||||
# Licensed 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.
|
||||
|
||||
# Server-only Linux validation image. The build context supplies a Git bundle.
|
||||
FROM rust:1.100.0-trixie AS build-tools
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates clang lld libssl-dev pkg-config protobuf-compiler python3 python3-boto3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ENV RUSTUP_TOOLCHAIN=1.100.0 \
|
||||
CARGO_BUILD_JOBS=4 \
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI=true \
|
||||
CARGO_TARGET_DIR=/work/rustfs/target \
|
||||
RUSTFLAGS="-C link-arg=-fuse-ld=lld"
|
||||
|
||||
FROM build-tools AS build
|
||||
ARG SOURCE_REVISION
|
||||
COPY repository.bundle /tmp/repository.bundle
|
||||
COPY inspect_geometry.rs /tmp/inspect_geometry.rs
|
||||
RUN git clone /tmp/repository.bundle /work/rustfs \
|
||||
&& git -C /work/rustfs checkout --detach "$SOURCE_REVISION" \
|
||||
&& test "$(git -C /work/rustfs rev-parse HEAD)" = "$SOURCE_REVISION"
|
||||
WORKDIR /work/rustfs
|
||||
RUN --mount=type=cache,id=rustfs-inline-registry,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,id=rustfs-inline-git,target=/usr/local/cargo/git \
|
||||
--mount=type=cache,id=rustfs-inline-linux-target,target=/work/rustfs/target \
|
||||
cargo build --locked --release --bin rustfs \
|
||||
&& install -Dm755 target/release/rustfs /out/rustfs
|
||||
|
||||
# Build the diagnostic tool after preserving the clean-source server binary.
|
||||
RUN cp /tmp/inspect_geometry.rs crates/filemeta/examples/inline_lab_inspect.rs
|
||||
RUN --mount=type=cache,id=rustfs-inline-registry,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,id=rustfs-inline-git,target=/usr/local/cargo/git \
|
||||
--mount=type=cache,id=rustfs-inline-linux-target,target=/work/rustfs/target \
|
||||
cargo build --locked --release -p rustfs-filemeta --example inline_lab_inspect \
|
||||
&& install -Dm755 target/release/examples/inline_lab_inspect /out/inline_lab_inspect
|
||||
|
||||
FROM debian:trixie-slim AS runtime
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl libssl3t64 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ARG SOURCE_REVISION
|
||||
LABEL org.opencontainers.image.revision="$SOURCE_REVISION" \
|
||||
rustfs.validation="inline"
|
||||
COPY --from=build /out/rustfs /usr/local/bin/rustfs
|
||||
COPY --from=build /out/inline_lab_inspect /usr/local/bin/inline_lab_inspect
|
||||
ENTRYPOINT ["/usr/local/bin/rustfs"]
|
||||
@@ -1,5 +0,0 @@
|
||||
FROM debian:trixie-slim
|
||||
COPY mc /usr/bin/mc
|
||||
RUN chmod 0755 /usr/bin/mc && /usr/bin/mc --version
|
||||
LABEL rustfs.validation="inline"
|
||||
ENTRYPOINT ["/usr/bin/mc"]
|
||||
@@ -1,133 +0,0 @@
|
||||
# Inline geometry Linux lab
|
||||
|
||||
**Use this when** validating inline placement, block geometry, Range reads and reader rollback in a task-owned local Docker cluster.
|
||||
|
||||
The adapter reuses the repository's four-node compose topology with 16 logical Docker volumes and EC12+4. It binds one S3 port to loopback, keeps strict durability and checks running binary hashes and persisted object geometry. Docker volumes share the host storage substrate. Performance observations describe this local virtualized lab.
|
||||
|
||||
## Build a frozen server image
|
||||
|
||||
Use the current stable toolchain pinned in the lab Dockerfile. Supply a Git bundle and the metadata inspector source as the build context. The server is compiled from a clean checkout before the diagnostic example is added.
|
||||
|
||||
```bash
|
||||
set -euo pipefail
|
||||
LAB_BUILD_DIR="$(mktemp -d)"
|
||||
LAB_REVISION="$(git rev-parse HEAD)"
|
||||
git bundle create "$LAB_BUILD_DIR/repository.bundle" HEAD
|
||||
cp crates/filemeta/examples/inline_lab_inspect.rs "$LAB_BUILD_DIR/inspect_geometry.rs"
|
||||
docker --context "$LAB_CONTEXT" build --target build-tools \
|
||||
-t rustfs-inline-build-tools:1.100 \
|
||||
-f .docker/inline-lab/Dockerfile .docker/inline-lab
|
||||
docker --context "$LAB_CONTEXT" build \
|
||||
--build-arg SOURCE_REVISION="$LAB_REVISION" \
|
||||
-t rustfs-inline-validation:local \
|
||||
-f .docker/inline-lab/Dockerfile "$LAB_BUILD_DIR"
|
||||
LAB_EXPORT_ID="$(docker --context "$LAB_CONTEXT" create \
|
||||
--label rustfs.validation=inline rustfs-inline-validation:local)"
|
||||
docker --context "$LAB_CONTEXT" cp \
|
||||
"$LAB_EXPORT_ID:/usr/local/bin/rustfs" "$LAB_BUILD_DIR/rustfs-linux"
|
||||
docker --context "$LAB_CONTEXT" rm "$LAB_EXPORT_ID"
|
||||
```
|
||||
|
||||
## Configure and probe
|
||||
|
||||
Select a new compose project and a private state directory. The adapter generates test credentials there. Existing resources require matching ownership labels. Configure checks the image's source revision and pins immutable image IDs. Each operation takes an exclusive state lock. Deployment waits for `/health/ready` on every node, covering storage, IAM, lock quorum and peer dependencies.
|
||||
|
||||
```bash
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" configure \
|
||||
--context "$LAB_CONTEXT" --project "$LAB_PROJECT" \
|
||||
--image rustfs-inline-validation:local --revision "$LAB_REVISION" \
|
||||
--binary "$LAB_BUILD_DIR/rustfs-linux" --port 19080
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" deploy \
|
||||
--bucket inline-geometry-probe --shard-bytes 0
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" probe \
|
||||
--bucket inline-geometry-probe
|
||||
```
|
||||
|
||||
The probe verifies complete bytes, HEAD sizes, Range contents, EC12+4 and the actual persisted block. It records inline markers for 4 KiB, 1 MiB, 1 MiB + 1 byte, 1.25 MiB, 1,572,856 bytes, 1,572,857 bytes and 1.5 MiB objects in `probe.json`. The server-only image includes the existing filemeta decoder through a small geometry inspector. Console assets and the administration CLI are outside this lab image.
|
||||
|
||||
## ABBA deployment hook
|
||||
|
||||
Use `inline_docker_lab.py ... deploy` in the existing `run_hotpath_warp_abba.sh` external deploy hook. Export `RUSTFS_ERASURE_SHARD_BYTES` according to `HOTPATH_ABBA_PHASE`. The adapter uses the supplied leg, phase, bucket, binary and evidence-file context, resets only owned lab volumes, checks running configuration and binary hashes, creates the fresh bucket and writes the runner's deployment evidence.
|
||||
|
||||
Use the same frozen binary for both sides of a geometry experiment. Fix the inline budget and encoding mode, then compare zero with one candidate shard value. Include the CPU, memory and image identities from every node in each result. The state `config.json` supplies the generated test credentials for the load driver. Set `DOCKER_CONTEXT` to the selected context when the driver captures Docker resource snapshots.
|
||||
|
||||
For content compatibility across an image or geometry change, configure the next selected image and artifact using the same state, then deploy with `--keep-data` and an existing bucket. This retains owned volumes. Compare existing objects and version IDs with the manifest prepared before the change.
|
||||
|
||||
## Cleanup
|
||||
|
||||
```bash
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" down --purge
|
||||
```
|
||||
|
||||
Cleanup checks ownership for containers, volumes and networks. A configuration cannot adopt another project's resources. Raw measurements, state, Git bundles and build outputs stay in task artifact directories.
|
||||
|
||||
Unit checks run with `scripts/python_bin.sh scripts/test_inline_docker_lab.py` and are included in `make script-tests`.
|
||||
|
||||
## Linux content-probe client
|
||||
|
||||
The PUT after-probe requires a working `mc`. For a macOS client affected by cgo initialization failures, compile the same frozen public mc module for Linux with CGO disabled, build it with `Dockerfile.mc`, and use `scripts/inline_docker_mc.sh` as the process-local `mc` command. Record the module version, checksum and resulting image ID with the run.
|
||||
|
||||
The adapter rewrites only the lab loopback alias endpoint to the private `node1` endpoint. Alias configuration stays in the probe's own `MC_CONFIG_DIR`, and `cat` streams raw bytes. The existing HEAD, GET and hash checks continue to execute.
|
||||
|
||||
```bash
|
||||
export RUSTFS_INLINE_LAB_STATE="$LAB_STATE"
|
||||
export RUSTFS_INLINE_MC_IMAGE="$LAB_MC_IMAGE"
|
||||
mkdir -p "$LAB_TOOLS"
|
||||
ln -s "$PWD/scripts/inline_docker_mc.sh" "$LAB_TOOLS/mc"
|
||||
export PATH="$LAB_TOOLS:$PATH"
|
||||
```
|
||||
|
||||
## Compare transport and placement independently
|
||||
|
||||
`deploy --rpc-mode json-compat` explicitly clears both MessagePack-only flags on every node. `deploy --rpc-mode msgpack-only` enables both flags for the selected homogeneous lab fleet. Deployment evidence records the mode and checks both running flags. The default is `json-compat`. The ABBA hook may select the same mode through `RUSTFS_INLINE_LAB_RPC_MODE`.
|
||||
|
||||
First compare the base and bounded-multi-block binaries at `--shard-bytes 0` in JSON compatibility mode. Then repeat with MessagePack-only on both sides. A same-binary transport ABBA isolates the encoding effect. Keep the 128 KiB budget, CPU sets, strict durability, load and object set fixed. Check actual markers and block sizes at the boundary sizes before timing. Retain baseline-drift and candidate gates, error logs and raw request distributions.
|
||||
|
||||
For a rolling downgrade, redeploy the current binary with `--keep-data --rpc-mode json-compat` before introducing an older node. Check old and new reads, version IDs and batch deletes against the persisted manifest. A running MessagePack-only flag pair establishes the lab configuration. Compatibility with a particular old reader requires the explicit reader test.
|
||||
|
||||
## Preserve a compatibility manifest
|
||||
|
||||
Run the seed once in a fresh lab bucket. It records full byte oracles and the observed version inventory, including any additional version matching a known body, and leaves a 5 MiB multipart part ready for the next reader. Each bucket has its own private `compat-<bucket>.json` manifest. Keep the same state and volumes across image changes. A fresh deployment or cleanup that resets volumes moves existing compatibility manifests into `compat-history`. Retained-data deployments preserve the active manifests.
|
||||
|
||||
```bash
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-seed --bucket inline-compat
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-check --bucket inline-compat
|
||||
# Configure the next frozen image and binary, then retain the data.
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" deploy \
|
||||
--bucket inline-compat --shard-bytes 0 --rpc-mode json-compat --keep-data
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-check --bucket inline-compat
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-finish-mpu --bucket inline-compat
|
||||
```
|
||||
|
||||
The check compares every persisted version ID, HEAD length, complete SHA256, cross-block Range and per-version geometry from `xl.meta`. The seed includes zero-length objects, null versions, the 192 KiB versioned admission boundary and the accumulated 128 KiB shard boundary. Seed a second bucket on the new writer before the downgrade, then check both manifests using the selected old reader. Complete an old upload on the new binary and a new upload on the old binary. After returning to the current fleet, `compat-delete --bucket <bucket>` deletes the recorded versions in one S3 batch and checks the exact remaining inventory and bytes.
|
||||
|
||||
Successful multipart-completion and batch-delete receipts are saved before subsequent content and geometry checks. If either check fails, rerun the same command with the same state directory to resume verification from the saved completion state. After a seed check fails with a saved manifest, use `compat-check` to resume verification.
|
||||
|
||||
For mixed-version testing, retain JSON compatibility mode throughout the rolling replacement. Verify each node's immutable image and binary, then perform manifest checks and new writes through both coordinator versions using `--coordinator node1` and `--coordinator node4`. The manifest records the actual writer coordinator revision from the running image. Stop one owned node to check read availability at EC12+4, restore it and check the manifests again. Record the exact oldest tested source revision, toolchain and build profile with the evidence. The version boundary is established by these executed cells.
|
||||
|
||||
An owned lab can replace just its fourth node through a compose image override. Select the frozen old image first and verify its revision label. Keep `compose.json` in JSON compatibility mode for this cell.
|
||||
|
||||
```bash
|
||||
set -euo pipefail
|
||||
OLD_IMAGE_ID="$(docker --context "$LAB_CONTEXT" image inspect "$OLD_IMAGE" --format '{{.Id}}')"
|
||||
test "$(docker --context "$LAB_CONTEXT" image inspect "$OLD_IMAGE_ID" --format '{{index .Config.Labels "org.opencontainers.image.revision"}}')" = "$OLD_REVISION"
|
||||
INLINE_OLD_IMAGE_ID="$OLD_IMAGE_ID" scripts/python_bin.sh - <<'PYTHON' > "$LAB_STATE/mixed-image.json"
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
override = {"services": {"node4": {"image": os.environ["INLINE_OLD_IMAGE_ID"]}}}
|
||||
json.dump(override, sys.stdout)
|
||||
PYTHON
|
||||
docker --context "$LAB_CONTEXT" compose --project-name "$LAB_PROJECT" \
|
||||
--file "$LAB_STATE/compose.json" --file "$LAB_STATE/mixed-image.json" \
|
||||
up --detach --no-deps --no-build --pull never node4
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-check \
|
||||
--bucket inline-compat --coordinator node4
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-seed \
|
||||
--bucket inline-mixed-writer --coordinator node4
|
||||
scripts/python_bin.sh scripts/inline_docker_lab.py --state-dir "$LAB_STATE" compat-check \
|
||||
--bucket inline-mixed-writer --coordinator node1
|
||||
```
|
||||
|
||||
Inspect all four running image IDs and binary hashes before recording the mixed-fleet result. Redeploy the configured current image with `--keep-data --rpc-mode json-compat` to restore a homogeneous fleet. The same manifest checks apply after stopping and restarting one owned node through the base compose file.
|
||||
@@ -34,10 +34,6 @@ If you want the Kafka-backed HA Tempo path, use `docker-compose-example-for-rust
|
||||
- **High Performance**: Optimized configurations for batching, compression, and memory management.
|
||||
- **Standardized Protocols**: Built entirely on OpenTelemetry standards.
|
||||
|
||||
## HTTP Request Latency Percentiles
|
||||
|
||||
The main RustFS dashboard shows request latency percentiles in milliseconds. The HTTP server request, response-body chunk, and response-body stream histograms export bucket boundaries in seconds. During a rolling upgrade or rollback that changes the bucket layout, compute percentiles from nodes that share one layout and from a query window entirely on that layout. The bundled dashboard and recording rules use a five-minute window. The mean from `_sum` divided by `_count` remains usable across the change.
|
||||
|
||||
## GET Performance Optimization Dashboards
|
||||
|
||||
Three pre-built Grafana dashboards are included for monitoring RustFS GET performance optimization rollout:
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
- **高性能**: 针对批处理、压缩和内存管理进行了优化配置。
|
||||
- **标准化协议**: 完全基于 OpenTelemetry 标准构建。
|
||||
|
||||
## HTTP 请求延迟分位数
|
||||
|
||||
RustFS 主仪表盘以毫秒显示请求延迟分位数。HTTP 服务的请求耗时、响应体分块延迟和响应体流传输耗时直方图以秒为单位导出桶边界。滚动升级或回滚导致桶边界变化时,只对采用同一套桶边界的节点和时间窗口计算分位数。自带仪表盘和记录规则使用五分钟窗口。变更期间仍可用 `_sum` 除以 `_count` 计算平均值。
|
||||
|
||||
## GET 性能优化仪表盘
|
||||
|
||||
包含三个预构建的 Grafana 仪表盘,用于监控 RustFS GET 性能优化发布:
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# Copyright 2026 RustFS Team
|
||||
#
|
||||
# Licensed 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.
|
||||
|
||||
name: Both-stack leg
|
||||
description: Prove which S3 stack one e2e leg's servers selected and upload the leg for the summary (call with if always)
|
||||
|
||||
inputs:
|
||||
profile:
|
||||
description: The nextest profile the leg ran
|
||||
required: true
|
||||
stack:
|
||||
description: The stack the leg requested, legacy or gateway
|
||||
required: true
|
||||
logs:
|
||||
description: Directory or file holding the servers' output
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Prove which stack the servers selected
|
||||
shell: bash
|
||||
env:
|
||||
PROFILE: ${{ inputs.profile }}
|
||||
STACK: ${{ inputs.stack }}
|
||||
LOGS: ${{ inputs.logs }}
|
||||
run: |
|
||||
# Outside the workspace: e2e_binary.py refuses a run whose source tree changed.
|
||||
mkdir -p "$RUNNER_TEMP/leg"
|
||||
junit="target/nextest/${PROFILE}/junit.xml"
|
||||
if [ -s "$junit" ]; then cp "$junit" "$RUNNER_TEMP/leg/junit.xml"; fi
|
||||
# A gateway leg stopped by its preflight has no output; the preflight's stack.json stays.
|
||||
if [ -e "$LOGS" ]; then python3 scripts/dual_stack.py stack --expect "$STACK" --out "$RUNNER_TEMP/leg/stack.json" "$LOGS"; fi
|
||||
|
||||
- name: Upload the leg
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: dual-stack-leg-${{ inputs.profile }}-${{ inputs.stack }}
|
||||
overwrite: true
|
||||
path: ${{ runner.temp }}/leg
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
@@ -0,0 +1,56 @@
|
||||
# Copyright 2026 RustFS Team
|
||||
#
|
||||
# Licensed 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.
|
||||
|
||||
name: Both-stack summary
|
||||
description: Diff the legacy and gateway legs of this run (scripts/junit_diff.py) and upload one dated summary
|
||||
|
||||
inputs:
|
||||
profiles:
|
||||
description: Comma-separated nextest profiles whose two legs this run uploaded
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download the legs
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: dual-stack-leg-*
|
||||
path: legs
|
||||
|
||||
- name: Diff every profile and write the summary
|
||||
id: summary
|
||||
shell: bash
|
||||
env:
|
||||
PROFILES: ${{ inputs.profiles }}
|
||||
run: |
|
||||
# The shell runs with -e; the exit status is reported after the summary is written.
|
||||
set +e -u -o pipefail
|
||||
date="$(date -u +%F)"
|
||||
echo "date=${date}" >> "$GITHUB_OUTPUT"
|
||||
mkdir -p legs
|
||||
python3 scripts/dual_stack.py summary --profiles "$PROFILES" --legs legs --date "$date" --out-dir dual-stack
|
||||
status=$?
|
||||
if [ -f dual-stack/summary.md ]; then cat dual-stack/summary.md >> "$GITHUB_STEP_SUMMARY"; fi
|
||||
exit "$status"
|
||||
|
||||
- name: Upload the dated summary
|
||||
if: always() && steps.summary.outputs.date != ''
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: dual-stack-summary-${{ steps.summary.outputs.date }}
|
||||
overwrite: true
|
||||
path: dual-stack
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
@@ -44,33 +44,6 @@ runs:
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Read the gateway pin
|
||||
id: gateway-pin
|
||||
shell: bash
|
||||
run: python3 scripts/gateway_corpus_capture.py pins >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Checkout the pinned admin route inventory and collector
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
repository: rustfs/gateway
|
||||
ref: ${{ steps.gateway-pin.outputs.rev }}
|
||||
# The collector requires a clean RustFS checkout.
|
||||
path: target/gateway-admin-census
|
||||
persist-credentials: false
|
||||
sparse-checkout-cone-mode: false
|
||||
sparse-checkout: |
|
||||
/scripts/
|
||||
/crates/goldens/src/migration_inventory/rustfs_admin_routes_native.json
|
||||
/crates/dialect-rustfs-admin/Cargo.toml
|
||||
/crates/dialect-rustfs-admin/src/lib.rs
|
||||
/crates/dialect-rustfs-admin/src/native.rs
|
||||
/crates/dialect-rustfs-admin/src/native/
|
||||
/crates/dialect-rustfs-admin/src/ops/
|
||||
|
||||
- name: Compare registered admin routes with the gateway native inventory
|
||||
shell: bash
|
||||
run: python3 scripts/check_gateway_admin_census.py --gateway target/gateway-admin-census
|
||||
|
||||
- name: Install workflow parser
|
||||
shell: bash
|
||||
run: python3 -m pip install --disable-pip-version-check PyYAML==6.0.3
|
||||
@@ -134,10 +107,6 @@ runs:
|
||||
git cat-file -e "$FOOTPRINT_BASE^{commit}" 2>/dev/null || git fetch --no-tags --depth=1 origin "$FOOTPRINT_BASE"
|
||||
./scripts/check_s3s_footprint.sh --base "$FOOTPRINT_BASE"
|
||||
|
||||
- name: Check s3s edge allowlist
|
||||
shell: bash
|
||||
run: ./scripts/check_s3s_footprint.sh --mode allowlist
|
||||
|
||||
- name: Check release feature boundaries
|
||||
shell: bash
|
||||
run: python3 scripts/check_connect_release_boundary.py --features-only
|
||||
|
||||
@@ -33,9 +33,6 @@ outputs:
|
||||
path:
|
||||
description: "Absolute path of the verified executable"
|
||||
value: ${{ steps.unpack.outputs.path }}
|
||||
executable-sha256:
|
||||
description: "SHA-256 of the executable extracted from the verified archive"
|
||||
value: ${{ steps.unpack.outputs.executable-sha256 }}
|
||||
version:
|
||||
description: "Pinned reference version"
|
||||
value: ${{ steps.pin.outputs.version }}
|
||||
@@ -96,6 +93,4 @@ runs:
|
||||
test -x "$path"
|
||||
echo "Reference executable: $path"
|
||||
"$path" --version
|
||||
digest="$(sha256sum "$path")"
|
||||
echo "executable-sha256=${digest%% *}" >> "$GITHUB_OUTPUT"
|
||||
echo "path=$path" >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -6,9 +6,8 @@ runs:
|
||||
- name: Install runtime tools
|
||||
shell: bash
|
||||
run: |
|
||||
# These runners have no IPv6 route to the Git PPA inherited from the image.
|
||||
sudo apt-get -o Acquire::ForceIPv4=true update
|
||||
sudo apt-get -o Acquire::ForceIPv4=true install -y libssl-dev ripgrep
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libssl-dev ripgrep
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
|
||||
- name: Install cargo-nextest
|
||||
|
||||
@@ -22,8 +22,6 @@ Identify the tested commit and any local changes. When testing a prebuilt binary
|
||||
List relevant checks not run and the remaining risk. Use the validation tier in AGENTS.md; do not run broader checks solely to fill this section. For documentation-only changes, list the applicable documentation checks. Use N/A only when verification is not applicable.
|
||||
-->
|
||||
|
||||
**auto-testing regression coverage** <!-- For each issue-backed bug fix, give the added or extended case ID or PR link, the existing case ID/path and assertion that catches the bug, or "Skipped" with a brief reason. Omit this line for other changes, including documentation-only fixes. -->
|
||||
|
||||
## Impact
|
||||
<!--
|
||||
Describe user-facing, compatibility, API, deployment, configuration, or documentation impact. Use N/A when there is no expected impact.
|
||||
|
||||
@@ -523,30 +523,6 @@
|
||||
"monitor_reason": "Event-driven or operator-requested work has no periodic freshness obligation.",
|
||||
"origin": "baseline"
|
||||
},
|
||||
{
|
||||
"workflow": ".github/workflows/agent-v1-protocol-regression.yml",
|
||||
"name": "Agent v1 protocol regression",
|
||||
"roles": [
|
||||
"pr",
|
||||
"push",
|
||||
"manual"
|
||||
],
|
||||
"events": [
|
||||
"pull_request",
|
||||
"push",
|
||||
"workflow_dispatch"
|
||||
],
|
||||
"cadence": "event",
|
||||
"timezone": "UTC",
|
||||
"schedule": [],
|
||||
"owner": "@overtrue",
|
||||
"policy": "active",
|
||||
"monitor": "none",
|
||||
"result_owner": "agent-v1-protocol-regression.yml",
|
||||
"disposition": "validates Agent v1 schemas and fixture integrity",
|
||||
"monitor_reason": "Runs on changes to the Agent v1 contract and on request.",
|
||||
"origin": "added"
|
||||
},
|
||||
{
|
||||
"workflow": ".github/workflows/connect-diagnostic-schedule-acceptance.yml",
|
||||
"name": "Connect diagnostic scheduler receipt acceptance",
|
||||
@@ -838,7 +814,7 @@
|
||||
"monitor": "workflow",
|
||||
"max_age_hours": 36,
|
||||
"result_owner": "dual-stack-nightly.yml",
|
||||
"disposition": "nightly run of the two e2e profiles only ci.yml runs, on the gateway stack, with the JUnit reports retained for 30 days",
|
||||
"disposition": "both-stack JUnit diff of the two profiles only ci.yml runs; the gateway legs are report-only until T2.10",
|
||||
"failure_owner": "watchdog",
|
||||
"origin": "added"
|
||||
},
|
||||
@@ -1054,6 +1030,33 @@
|
||||
"failure_owner": "watchdog",
|
||||
"origin": "added"
|
||||
},
|
||||
{
|
||||
"workflow": ".github/workflows/gateway-integration-sync.yml",
|
||||
"name": "Gateway Integration Sync",
|
||||
"roles": [
|
||||
"periodic",
|
||||
"manual",
|
||||
"maintenance"
|
||||
],
|
||||
"events": [
|
||||
"schedule",
|
||||
"workflow_dispatch"
|
||||
],
|
||||
"cadence": "nightly",
|
||||
"timezone": "UTC",
|
||||
"schedule": [
|
||||
"0 2 * * 1-5"
|
||||
],
|
||||
"owner": "@overtrue",
|
||||
"policy": "active",
|
||||
"monitor": "workflow",
|
||||
"max_age_hours": 36,
|
||||
"result_owner": "gateway-integration-sync.yml",
|
||||
"disposition": "retained independent entry",
|
||||
"failure_owner": "workflow",
|
||||
"origin": "baseline",
|
||||
"alert_contract": "independent"
|
||||
},
|
||||
{
|
||||
"workflow": ".github/workflows/helm-package.yml",
|
||||
"name": "Build candidate Helm chart",
|
||||
@@ -1154,17 +1157,17 @@
|
||||
"workflow_dispatch",
|
||||
"schedule"
|
||||
],
|
||||
"cadence": "nightly",
|
||||
"cadence": "weekly",
|
||||
"timezone": "UTC",
|
||||
"schedule": [
|
||||
"41 6 * * *"
|
||||
"41 6 * * 0"
|
||||
],
|
||||
"owner": "@overtrue",
|
||||
"policy": "active",
|
||||
"monitor": "workflow",
|
||||
"max_age_hours": 36,
|
||||
"max_age_hours": 192,
|
||||
"result_owner": "mint.yml",
|
||||
"disposition": "nightly dual-stack mint comparison (pinned reference release vs candidate) with fail-closed diff-table gate",
|
||||
"disposition": "retained independent entry",
|
||||
"failure_owner": "workflow",
|
||||
"origin": "baseline",
|
||||
"alert_contract": "scheduled-validation"
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
name: Agent v1 protocol regression
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "protocol/agent/v1/**"
|
||||
- "scripts/test_agent_v1_*.py"
|
||||
- "scripts/verify_agent_v1_fixtures.py"
|
||||
- "scripts/run_agent_v1_regression.sh"
|
||||
- "rustfs/src/connect/diagnostics/job.rs"
|
||||
- "rustfs/src/connect/diagnostics/job_delivery.rs"
|
||||
- ".github/workflows/agent-v1-protocol-regression.yml"
|
||||
push:
|
||||
paths:
|
||||
- "protocol/agent/v1/**"
|
||||
- "scripts/test_agent_v1_*.py"
|
||||
- "scripts/verify_agent_v1_fixtures.py"
|
||||
- "scripts/run_agent_v1_regression.sh"
|
||||
- "rustfs/src/connect/diagnostics/job.rs"
|
||||
- "rustfs/src/connect/diagnostics/job_delivery.rs"
|
||||
- ".github/workflows/agent-v1-protocol-regression.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: agent-v1-protocol-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
protocol-regression:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
cache-dependency-path: protocol/agent/v1/requirements.txt
|
||||
- name: Install test dependencies
|
||||
run: python -m pip install -r protocol/agent/v1/requirements.txt
|
||||
- name: Run Agent v1 contract regression suite
|
||||
run: scripts/run_agent_v1_regression.sh
|
||||
@@ -231,7 +231,7 @@ jobs:
|
||||
# --all-targets links the same test binaries as the reader lane.
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
run: |
|
||||
cargo build -p rustfs -p rustfs-ecstore -p rustfs-sse --all-targets --features rio-v2
|
||||
cargo build -p rustfs -p rustfs-ecstore --all-targets --features rio-v2
|
||||
cargo build -p rustfs --bins --features rio-v2,e2e-test-hooks
|
||||
|
||||
# Readers: the swift and sftp legs of test-and-lint-protocols. Built in
|
||||
|
||||
+195
-23
@@ -16,7 +16,9 @@ name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
# gateway/integration receives the daily merge of main as a direct push
|
||||
# (rustfs/backlog#2734), so its pushes must prove the result like main's.
|
||||
branches: [ main, gateway/integration ]
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "docs/**"
|
||||
@@ -36,7 +38,9 @@ on:
|
||||
- "flake.lock"
|
||||
pull_request:
|
||||
types: [ opened, synchronize, reopened, closed ]
|
||||
branches: [ main ]
|
||||
# gateway/integration carries main's ruleset (rustfs/backlog#2734), so its
|
||||
# pull requests must produce the same required checks.
|
||||
branches: [ main, gateway/integration ]
|
||||
merge_group:
|
||||
types: [ checks_requested ]
|
||||
schedule:
|
||||
@@ -88,6 +92,7 @@ jobs:
|
||||
connect: ${{ steps.scope.outputs.connect || 'true' }}
|
||||
packages: ${{ steps.scope.outputs.packages }}
|
||||
full_validation: ${{ steps.scope.outputs.full_validation || 'true' }}
|
||||
gateway_smoke: ${{ steps.scope.outputs.gateway_smoke || 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
@@ -114,7 +119,7 @@ jobs:
|
||||
echo "Base CI policy unavailable; running the full matrix."
|
||||
fi
|
||||
if ! grep -q '^plan=' "$GITHUB_OUTPUT" || ! grep -q '^plan_contract=8$' "$GITHUB_OUTPUT"; then
|
||||
printf '%s\n' 'mode=full' 'connect=true' 'full_validation=true' 'packages=' 'plan=' >> "$GITHUB_OUTPUT"
|
||||
printf '%s\n' 'mode=full' 'connect=true' 'full_validation=true' 'gateway_smoke=true' 'packages=' 'plan=' >> "$GITHUB_OUTPUT"
|
||||
echo "Base policy does not cover this workflow contract; retaining the full matrix."
|
||||
fi
|
||||
- name: Retain verification plan
|
||||
@@ -502,10 +507,6 @@ jobs:
|
||||
if: matrix.mode == 'fips'
|
||||
run: sudo apt-get install -y cmake golang clang libclang-dev
|
||||
|
||||
- name: Check the native SigV4 crypto services
|
||||
if: matrix.mode == 'fips'
|
||||
run: ./scripts/sigv4-fips/check.sh
|
||||
|
||||
- name: Verify provider installation
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -563,7 +564,7 @@ jobs:
|
||||
run: chmod go-w "$(realpath "$HOME")"
|
||||
|
||||
- name: Run rio-v2 clippy lints
|
||||
run: cargo clippy -p rustfs -p rustfs-ecstore -p rustfs-sse --all-targets --features rio-v2 -- -D warnings
|
||||
run: cargo clippy -p rustfs -p rustfs-ecstore --all-targets --features rio-v2 -- -D warnings
|
||||
|
||||
- name: Run rio-v2 feature tests
|
||||
shell: bash
|
||||
@@ -580,7 +581,7 @@ jobs:
|
||||
rm -f target/nextest/ci/junit.xml
|
||||
./scripts/ci/resource_sampler.sh start nextest-rio-v2
|
||||
trap './scripts/ci/resource_sampler.sh stop' EXIT
|
||||
cargo nextest run --profile ci -p rustfs -p rustfs-ecstore -p rustfs-sse --features rio-v2 \
|
||||
cargo nextest run --profile ci -p rustfs -p rustfs-ecstore --features rio-v2 \
|
||||
2>&1 | tee artifacts/workspace/nextest.log
|
||||
cargo test -p rustfs --doc --features rio-v2
|
||||
|
||||
@@ -675,6 +676,54 @@ jobs:
|
||||
retention-days: 3
|
||||
if-no-files-found: warn
|
||||
|
||||
test-and-lint-gateway-stack:
|
||||
name: Test and Lint (gateway-stack)
|
||||
# The gateway S3 stack (rustfs/backlog#2734) sits behind the rustfs
|
||||
# `gateway-stack` feature, which no other pull-request lane lints or tests.
|
||||
# Unlike the dormant feature lanes above, this one runs for every code
|
||||
# change: each operation slice puts its handler tests and its refusal-matrix
|
||||
# row behind the feature, and a lane that ran only on demand would let them
|
||||
# rot behind a green pull request.
|
||||
if: needs.classify-changes.outputs.mode == 'full' && (github.event_name != 'pull_request' || github.event.action != 'closed')
|
||||
needs: [ quick-checks, classify-changes ]
|
||||
# Self-hosted for build scale and cache ownership: a workspace-scale Cargo
|
||||
# build that reads the ci-dev cache written on this image.
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Rust environment
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
rust-version: stable
|
||||
cache-shared-key: ci-dev-ea7eec74fe14
|
||||
cache-save-if: 'false'
|
||||
install-build-packaging-tools: 'false'
|
||||
|
||||
# A feature that does not compile fails here; nothing below is skipped
|
||||
# into a pass.
|
||||
- name: Run clippy with gateway-stack
|
||||
run: cargo clippy --locked -p rustfs --all-targets --features gateway-stack -- -D warnings
|
||||
|
||||
# The gateway stack's own tests: the assembly, the operation table and
|
||||
# its completeness, the shared handler sequence, the stack selection, and
|
||||
# the embedded server driven through the whole middleware stack. The
|
||||
# filter names modules, never operations.
|
||||
- name: Run tests with gateway-stack
|
||||
env:
|
||||
# The same bounded link concurrency as the other feature lanes.
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
run: |
|
||||
cargo nextest run --profile ci --locked -p rustfs --features gateway-stack --no-tests fail \
|
||||
--status-level all --final-status-level all \
|
||||
-E 'test(/gateway_stack|gateway_handlers|server::stack::/) | binary(embedded_gateway_stack_test)'
|
||||
|
||||
build-rustfs-debug-binary:
|
||||
name: Build RustFS Debug Binary
|
||||
if: contains(fromJSON('["full", "e2e"]'), needs.classify-changes.outputs.mode) && (github.event_name != 'pull_request' || github.event.action != 'closed')
|
||||
@@ -937,6 +986,8 @@ jobs:
|
||||
# Retain the producer image and fixture paths until the runtime pilot passes.
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
RUSTFS_S3_STACK: legacy
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
@@ -1057,18 +1108,137 @@ jobs:
|
||||
path: ${{ runner.temp }}/rustfs-e2e-*/rustfs.log
|
||||
retention-days: 3
|
||||
|
||||
# The same e2e-smoke suite against the same debug binary with the gateway
|
||||
# S3 stack selected (rustfs/backlog#2734). Report-only: it is outside the
|
||||
# Test and Lint aggregate and becomes required at T2.10. The test-binary
|
||||
# download, identity, membership, run and completeness steps must stay
|
||||
# identical to e2e-tests; scripts/ci_gate.py enforces that.
|
||||
#
|
||||
# When it runs: every push to main or gateway/integration, merge group,
|
||||
# nightly schedule and manual dispatch, and every pull request that changes a
|
||||
# gateway-stack input (GATEWAY_SMOKE_PATHS and the rustfs-gateway pins in
|
||||
# scripts/ci_gate.py, published by Select CI scope as gateway_smoke).
|
||||
# Why it is skipped on every other pull request: until T2.10 the gateway
|
||||
# stack does not serve the whole smoke suite, so the lane fails on any
|
||||
# revision. A pull request that touches none of its inputs can neither cause
|
||||
# nor fix that failure, and a red check there says nothing about the change.
|
||||
# Skipped is the honest state; a failure must never be rendered green, so no
|
||||
# step here may carry continue-on-error. A selection that is missing or
|
||||
# unreadable runs the lane. At T2.10, when the lane becomes required, it
|
||||
# must run on every pull request again: delete the selection, do not extend
|
||||
# it.
|
||||
e2e-tests-gateway:
|
||||
name: e2e-smoke (gateway, report-only until T2.10)
|
||||
needs: [ classify-changes, build-rustfs-debug-binary ]
|
||||
if: github.event_name != 'pull_request' || needs.classify-changes.outputs.gateway_smoke != 'false'
|
||||
runs-on: sm-standard-2
|
||||
timeout-minutes: 30
|
||||
continue-on-error: true
|
||||
env:
|
||||
RUSTFS_S3_STACK: gateway
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install verification runtime
|
||||
uses: ./.github/actions/test-runtime
|
||||
|
||||
- name: Download E2E test binaries
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: e2e-test-binaries
|
||||
path: ${{ runner.temp }}
|
||||
|
||||
- name: Verify E2E archive identity
|
||||
run: python3 scripts/ci_test_artifact.py verify --configuration e2e --archive "$RUNNER_TEMP/e2e-tests.tar.zst"
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install awscurl
|
||||
run: |
|
||||
python3 -m pip install --user --upgrade pip "awscurl==0.44"
|
||||
echo "AWSCURL_PATH=$HOME/.local/bin/awscurl" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify awscurl
|
||||
run: test -x "$AWSCURL_PATH"
|
||||
|
||||
# Download after the cache restore so the freshly built binary from the
|
||||
# build job always wins over anything restored into target/debug.
|
||||
- name: Download debug binary
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: rustfs-debug-binary
|
||||
path: target/debug
|
||||
|
||||
- name: Make binary executable
|
||||
run: chmod +x ./target/debug/rustfs
|
||||
|
||||
# Build the e2e test graph once. The archive is reused by the smoke
|
||||
# selection guard, security exact-count check, and run below, avoiding a
|
||||
# second compile of the same e2e_test target on cold runners (backlog#1645).
|
||||
- name: Verify e2e smoke test membership
|
||||
env:
|
||||
NEXTEST_ARCHIVE: ${{ runner.temp }}/e2e-tests.tar.zst
|
||||
NEXTEST_LISTING: ${{ runner.temp }}/rustfs-e2e-smoke-list.json
|
||||
run: |
|
||||
cargo nextest list --profile e2e-smoke --archive-file "${NEXTEST_ARCHIVE}" --workspace-remap "$GITHUB_WORKSPACE" --extract-to "$GITHUB_WORKSPACE" --extract-overwrite --message-format json > "${NEXTEST_LISTING}"
|
||||
python3 ./scripts/check_test_wiring.py --check-profile e2e-smoke "${NEXTEST_LISTING}"
|
||||
./scripts/check_security_smoke_count.sh check "${NEXTEST_LISTING}"
|
||||
|
||||
# PR smoke subset of the in-repo e2e suite (backlog#1149 ci-4). The
|
||||
# profile.e2e-smoke default-filter in .config/nextest.toml is the single
|
||||
# wiring mechanism for e2e tests in CI — extend that filter instead of
|
||||
# adding new e2e jobs here. Each test spawns its own rustfs server on a
|
||||
# random port and reuses the downloaded debug binary above.
|
||||
- name: Run e2e smoke suite
|
||||
env:
|
||||
NEXTEST_ARCHIVE: ${{ runner.temp }}/e2e-tests.tar.zst
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-e2e-smoke-logs
|
||||
SAMPLER_INTERVAL_SECS: "15"
|
||||
run: |
|
||||
./scripts/ci/resource_sampler.sh start e2e-smoke
|
||||
trap './scripts/ci/resource_sampler.sh stop' EXIT
|
||||
python3 scripts/e2e_binary.py run --features e2e-test-hooks -- cargo nextest run --profile e2e-smoke --cargo-metadata target/nextest/cargo-metadata.json --binaries-metadata target/nextest/binaries-metadata.json --workspace-remap "$GITHUB_WORKSPACE" --target-dir-remap "$GITHUB_WORKSPACE/target" \
|
||||
--status-level all --final-status-level all --failure-output final
|
||||
|
||||
- name: Verify e2e smoke execution completeness
|
||||
run: python3 scripts/ci_test_artifact.py evidence "$RUNNER_TEMP/rustfs-e2e-smoke-list.json" target/nextest/e2e-smoke/junit.xml
|
||||
|
||||
- name: Upload e2e smoke diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-smoke-gateway-diagnostics-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: |
|
||||
${{ runner.temp }}/rustfs-e2e-smoke-logs/
|
||||
${{ runner.temp }}/rustfs-e2e-smoke-list.json
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload e2e smoke JUnit report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-smoke-gateway-junit-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: target/nextest/e2e-smoke/junit.xml
|
||||
if-no-files-found: warn
|
||||
|
||||
e2e-full:
|
||||
name: End-to-End Tests (full merge gate)
|
||||
# Merge gate only (backlog#1149 ci-5): the never-automated user-visible
|
||||
# suites — KMS, object_lock, multipart_auth, quota, checksum, encryption,
|
||||
# security-boundary, ... — via the e2e-full nextest profile. Too heavy for
|
||||
# every PR, so it is gated to main pushes, the merge
|
||||
# every PR, so it is gated to main and gateway/integration pushes, the merge
|
||||
# queue, and manual dispatch. protocols / the 7 cluster suites / replication
|
||||
# / #[ignore] are owned by other lanes (see .config/nextest.toml profile.e2e-full).
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event_name == 'merge_group' ||
|
||||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
|
||||
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/gateway/integration'))
|
||||
needs: [ build-rustfs-debug-binary ]
|
||||
# Retain the producer image and fixture paths until the runtime pilot passes.
|
||||
runs-on: sm-standard-4
|
||||
@@ -1091,12 +1261,9 @@ jobs:
|
||||
- name: Verify E2E archive identity
|
||||
run: python3 scripts/ci_test_artifact.py verify --configuration e2e --archive "$RUNNER_TEMP/e2e-tests.tar.zst"
|
||||
|
||||
- name: Install network fault-injection tools and the persistence test clock
|
||||
- name: Install network fault-injection tools
|
||||
run: |
|
||||
sudo apt-get install -y iptables libfaketime
|
||||
clock_library="$(dpkg-query -L libfaketime | grep -E '/libfaketime[.]so[.]1$')"
|
||||
test -f "$clock_library"
|
||||
echo "RUSTFS_PERSISTENCE_CLOCK_LIBRARY=$clock_library" >> "$GITHUB_ENV"
|
||||
sudo apt-get install -y iptables
|
||||
sudo -n iptables --version
|
||||
# The endpoint-blackhole heal scenario needs CAP_NET_ADMIN. Containerised
|
||||
# runners can run iptables but not touch the rule set; the test then logs
|
||||
@@ -1203,14 +1370,8 @@ jobs:
|
||||
# default-filter in .config/nextest.toml is the single wiring mechanism —
|
||||
# extend that filter, never add ad-hoc e2e jobs here. Reuses the downloaded
|
||||
# debug binary; each test spawns its own rustfs server on a random port.
|
||||
- name: Download pinned release for persistence byte parity
|
||||
id: persistence-reference
|
||||
uses: ./.github/actions/reference-binary
|
||||
|
||||
- name: Run e2e full suite
|
||||
env:
|
||||
RUSTFS_PERSISTENCE_REFERENCE_BINARY: ${{ steps.persistence-reference.outputs.path }}
|
||||
RUSTFS_PERSISTENCE_XML_DIR: ${{ runner.temp }}/rustfs-persistence-xml
|
||||
CARGO_BIN_EXE_rustfs: ${{ runner.temp }}/rustfs-startup-cas-input/rustfs
|
||||
RUSTFS_E2E_STARTUP_CAS_BINARY: ${{ runner.temp }}/rustfs-startup-cas-input/rustfs
|
||||
RUSTFS_E2E_STARTUP_CAS_BUILD_MANIFEST: ${{ runner.temp }}/rustfs-startup-cas-input/rustfs.e2e-startup-cas-build.json
|
||||
@@ -1229,7 +1390,6 @@ jobs:
|
||||
path: |
|
||||
target/nextest/e2e-full/junit.xml
|
||||
${{ runner.temp }}/rustfs-e2e-full-list.json
|
||||
${{ runner.temp }}/rustfs-persistence-xml
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload startup CAS evidence
|
||||
@@ -1370,6 +1530,15 @@ jobs:
|
||||
# the intermediate 4-object plateau requires 4*lc_interval < 5*debug_day, i.e.
|
||||
# debug_day > 8. A smaller value lets the Days=5 rule fire inside the Days=1
|
||||
# poll window so the count collapses straight to 2 and the test fails (#4764).
|
||||
#
|
||||
# RUSTFS_DATA_USAGE_UPDATE_DIR_CYCLES=1 is also required. A compacted directory
|
||||
# is only re-descended (and its objects re-evaluated for ILM) once every
|
||||
# DATA_USAGE_UPDATE_DIR_CYCLES scanner cycles (default 16). At the accelerated
|
||||
# RUSTFS_SCANNER_CYCLE=2 that is ~32s between evaluations, so a Days=1 object
|
||||
# that becomes due at debug_day (10s) is not actually expired until the next
|
||||
# ~32s boundary (~42s), landing just past the 4*lc_interval (40s) poll window
|
||||
# and making the count stall at 6 (#4767). Forcing every-cycle re-descent
|
||||
# evaluates ILM within ~2s of the due time, well inside the poll window.
|
||||
s3-lifecycle-behavior-tests:
|
||||
name: S3 Lifecycle Behavior Tests
|
||||
# Also gated on e2e-tests, matching s3-implemented-tests: when the e2e smoke
|
||||
@@ -1411,6 +1580,7 @@ jobs:
|
||||
RUSTFS_ILM_PROCESS_TIME=1 \
|
||||
RUSTFS_SCANNER_ENABLED=true \
|
||||
RUSTFS_SCANNER_CYCLE=2 \
|
||||
RUSTFS_DATA_USAGE_UPDATE_DIR_CYCLES=1 \
|
||||
RUSTFS_SCANNER_START_DELAY_SECS=0 \
|
||||
RUSTFS_API_STALE_UPLOADS_CLEANUP_INTERVAL=2s \
|
||||
S3_PORT="${S3_PORT}" \
|
||||
@@ -1442,6 +1612,7 @@ jobs:
|
||||
- fips-provider
|
||||
- test-and-lint-rio-v2
|
||||
- test-and-lint-protocols
|
||||
- test-and-lint-gateway-stack
|
||||
- build-rustfs-debug-binary
|
||||
- uring-integration
|
||||
- e2e-tests
|
||||
@@ -1477,6 +1648,7 @@ jobs:
|
||||
- core-contract
|
||||
- test-and-lint-rio-v2
|
||||
- test-and-lint-protocols
|
||||
- test-and-lint-gateway-stack
|
||||
- build-rustfs-debug-binary
|
||||
- build-rustfs-debug-binary-rio-v2
|
||||
- uring-integration
|
||||
|
||||
@@ -12,18 +12,21 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Nightly run of the two e2e profiles only ci.yml runs, e2e-smoke and e2e-full
|
||||
# (rustfs/backlog#2772, T3.1), on the gateway stack, which is the only S3 stack.
|
||||
# The workflow keeps its file and registry name from the period when it diffed two
|
||||
# stacks. Each leg uploads its JUnit report and server logs for 30 days; the one
|
||||
# comparison against the last legacy record (the `dual-stack-leg-<profile>-legacy`
|
||||
# artifacts of the final both-stack run) is made by hand with scripts/junit_diff.py.
|
||||
# Nightly both-stack diff of the two e2e profiles only ci.yml runs, e2e-smoke
|
||||
# and e2e-full (rustfs/backlog#2772, T3.1). The other profiles carry a `stack`
|
||||
# dimension in their own workflows, where the existing lane is the legacy leg.
|
||||
#
|
||||
# Left out: `dual_stack_differential::` (servers with an explicit
|
||||
# One build serves every leg. One preflight starts that binary with
|
||||
# RUSTFS_S3_STACK=gateway (scripts/dual_stack.py preflight); without a proven
|
||||
# gateway start the gateway legs do not run and the summary says `skipped:
|
||||
# gateway stack refuses startup: <why>`. Which stack a leg ran is read from the
|
||||
# servers' own start-up line. The gateway legs are report-only until T2.10.
|
||||
#
|
||||
# Left out of both stacks: `dual_stack_differential::` (servers with an explicit
|
||||
# stack), `fake_s3_target::`, the upgrade write-readiness cases and one deadline
|
||||
# case (no server), and `distributed_startup_regression_test::` (needs ci.yml's
|
||||
# hooks-binary manifest). e2e-full uses ci.yml's pinned mc and Vault binaries
|
||||
# and network fault-injection tools.
|
||||
# hooks-binary manifest). Both e2e-full stacks use ci.yml's pinned mc and
|
||||
# Vault binaries and network fault-injection tools.
|
||||
|
||||
name: dual-stack-nightly
|
||||
|
||||
@@ -47,11 +50,13 @@ defaults:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build once
|
||||
name: Build once and probe the gateway stack
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
# The runner and cache of ci.yml's build-rustfs-debug-binary.
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 60
|
||||
outputs:
|
||||
stacks: ${{ steps.preflight.outputs.stacks }}
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
@@ -81,15 +86,47 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
# Without a proven gateway start there is no gateway leg to run.
|
||||
- name: Gateway preflight
|
||||
id: preflight
|
||||
run: |
|
||||
if python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/preflight/stack.json"; then
|
||||
echo 'stacks=["legacy","gateway"]' >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo 'stacks=["legacy"]' >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
# The evidence stands in for a gateway leg that is skipped; a leg that runs overwrites it.
|
||||
- name: Upload the preflight evidence for e2e-smoke
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: dual-stack-leg-e2e-smoke-gateway
|
||||
path: ${{ runner.temp }}/preflight
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload the preflight evidence for e2e-full
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: dual-stack-leg-e2e-full-gateway
|
||||
path: ${{ runner.temp }}/preflight
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
|
||||
leg:
|
||||
name: ${{ matrix.profile }}
|
||||
name: ${{ matrix.profile }} (${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
needs: [ build ]
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 120
|
||||
# Report-only until T2.10: the gateway stack cannot serve the suites yet.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile: [ e2e-smoke, e2e-full ]
|
||||
stack: ${{ fromJSON(needs.build.outputs.stacks) }}
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
@@ -123,14 +160,10 @@ jobs:
|
||||
echo "AWSCURL_PATH=$HOME/.local/bin/awscurl" >> "$GITHUB_ENV"
|
||||
test -x "$HOME/.local/bin/awscurl"
|
||||
|
||||
- name: Install network fault-injection tools and the persistence test clock
|
||||
- name: Install network fault-injection tools
|
||||
if: matrix.profile == 'e2e-full'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y iptables libfaketime
|
||||
clock_library="$(dpkg-query -L libfaketime | grep -E '/libfaketime[.]so[.]1$')"
|
||||
test -f "$clock_library"
|
||||
echo "RUSTFS_PERSISTENCE_CLOCK_LIBRARY=$clock_library" >> "$GITHUB_ENV"
|
||||
sudo apt-get install -y iptables
|
||||
sudo -n iptables --version
|
||||
# The endpoint-blackhole heal scenario needs CAP_NET_ADMIN. Containerised
|
||||
# runners can run iptables but not touch the rule set; the test then logs
|
||||
@@ -175,37 +208,35 @@ jobs:
|
||||
run: |
|
||||
"$RUSTFS_TEST_VAULT_BIN" version
|
||||
|
||||
- name: Download pinned release for persistence byte parity
|
||||
id: persistence-reference
|
||||
if: matrix.profile == 'e2e-full'
|
||||
uses: ./.github/actions/reference-binary
|
||||
|
||||
- name: Run the profile
|
||||
- name: Run the profile on the ${{ matrix.stack }} stack
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/server-logs
|
||||
PERSISTENCE_REFERENCE_BINARY: ${{ steps.persistence-reference.outputs.path }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ "$PROFILE" == "e2e-full" ]]; then
|
||||
test -x "$PERSISTENCE_REFERENCE_BINARY"
|
||||
test -f "$RUSTFS_PERSISTENCE_CLOCK_LIBRARY"
|
||||
export RUSTFS_PERSISTENCE_REFERENCE_BINARY="$PERSISTENCE_REFERENCE_BINARY"
|
||||
fi
|
||||
chmod +x target/debug/rustfs
|
||||
filter='not test(/^(dual_stack_differential|fake_s3_target|distributed_startup_regression_test)::/)'
|
||||
filter="$filter & not test(/^upgrade_compatibility_test::upgrade_write_readiness_tests::/)"
|
||||
filter="$filter & not test(=list_objects_v2_pagination_test::tests::test_list_objects_v2_deadline_rejects_unresponsive_peer)"
|
||||
python3 scripts/e2e_binary.py run --features e2e-test-hooks -- cargo nextest run --profile "$PROFILE" -p e2e_test -E "$filter"
|
||||
|
||||
- name: Upload the leg
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with: { profile: "${{ matrix.profile }}", stack: "${{ matrix.stack }}", logs: "${{ runner.temp }}/server-logs" }
|
||||
|
||||
summary:
|
||||
name: Both-stack diff summary
|
||||
needs: [ build, leg ]
|
||||
if: github.repository == 'rustfs/rustfs' && always()
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
name: e2e-nightly-${{ matrix.profile }}
|
||||
overwrite: true
|
||||
path: |
|
||||
target/nextest/${{ matrix.profile }}/junit.xml
|
||||
${{ runner.temp }}/server-logs
|
||||
if-no-files-found: warn
|
||||
retention-days: 30
|
||||
persist-credentials: false
|
||||
|
||||
- uses: ./.github/actions/dual-stack-summary
|
||||
with:
|
||||
profiles: e2e-smoke,e2e-full
|
||||
|
||||
@@ -53,11 +53,14 @@ concurrency:
|
||||
jobs:
|
||||
distributed:
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
name: Distributed 4-node 4-disk e2e
|
||||
name: Distributed 4-node 4-disk e2e (${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
# GitHub-hosted VM: loop and tmpfs mounts work here. sm-standard-4 is an
|
||||
# ARC pod and rejects both (`mount -o loop` ENOENT, tmpfs "read-only").
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 180
|
||||
# The gateway leg is report-only until T2.10.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy: { fail-fast: false, matrix: { stack: [legacy, gateway] } }
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
NO_PROXY: 127.0.0.1,localhost
|
||||
@@ -129,6 +132,11 @@ jobs:
|
||||
run: |
|
||||
python3 scripts/e2e_binary.py build --bins --features e2e-test-hooks
|
||||
|
||||
# A gateway binary that refuses to start skips the suite; the summary says why.
|
||||
- name: Gateway preflight
|
||||
if: matrix.stack == 'gateway'
|
||||
run: python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/leg/stack.json"
|
||||
|
||||
- name: Verify distributed e2e membership
|
||||
env:
|
||||
NEXTEST_LISTING: ${{ runner.temp }}/rustfs-e2e-distributed-list.json
|
||||
@@ -140,6 +148,7 @@ jobs:
|
||||
env:
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-e2e-distributed-logs
|
||||
FILTER: ${{ inputs.filter }}
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f target/nextest/e2e-distributed/junit.xml
|
||||
@@ -150,11 +159,19 @@ jobs:
|
||||
fi
|
||||
test -s target/nextest/e2e-distributed/junit.xml
|
||||
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with:
|
||||
profile: e2e-distributed
|
||||
stack: ${{ matrix.stack }}
|
||||
logs: ${{ runner.temp }}/rustfs-e2e-distributed-logs
|
||||
|
||||
- name: Upload distributed e2e diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-distributed-${{ github.run_number }}
|
||||
name: e2e-distributed-${{ github.run_number }}-${{ matrix.stack }}
|
||||
path: |
|
||||
target/nextest/e2e-distributed/junit.xml
|
||||
${{ runner.temp }}/rustfs-e2e-distributed-list.json
|
||||
@@ -174,6 +191,20 @@ jobs:
|
||||
fi
|
||||
done
|
||||
|
||||
dual-stack-summary:
|
||||
name: Both-stack diff summary
|
||||
needs: [distributed]
|
||||
if: github.repository == 'rustfs/rustfs' && always()
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./.github/actions/dual-stack-summary
|
||||
with:
|
||||
profiles: e2e-distributed
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [distributed]
|
||||
|
||||
@@ -54,15 +54,18 @@ concurrency:
|
||||
jobs:
|
||||
repl-nightly:
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
name: Replication e2e (nightly)
|
||||
name: Replication e2e (nightly, ${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
# dual-node tests spawn two full rustfs servers each; the extra headroom
|
||||
# over the per-PR sm-standard-2 e2e job keeps the parallel process fan-out
|
||||
# from starving the runner. Mirrors the ILM serial lane's runner class.
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 45
|
||||
# The gateway leg is report-only until T2.10.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy: { fail-fast: false, matrix: { stack: [legacy, gateway] } }
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
RUSTFS_BUILD_FEATURES: ""
|
||||
RUSTFS_BUILD_FEATURES: ${{ matrix.stack == 'gateway' && 'gateway-stack' || '' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
@@ -96,6 +99,11 @@ jobs:
|
||||
run: |
|
||||
python3 scripts/e2e_binary.py build --bins --features "$RUSTFS_BUILD_FEATURES"
|
||||
|
||||
# A gateway binary that refuses to start skips the suite; the summary says why.
|
||||
- name: Gateway preflight
|
||||
if: matrix.stack == 'gateway'
|
||||
run: python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/leg/stack.json"
|
||||
|
||||
- name: Verify replication e2e membership
|
||||
env:
|
||||
NEXTEST_LISTING: ${{ runner.temp }}/rustfs-e2e-repl-nightly-list.json
|
||||
@@ -106,13 +114,22 @@ jobs:
|
||||
- name: Run replication e2e nightly suite
|
||||
env:
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-e2e-repl-nightly-logs
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
run: python3 scripts/e2e_binary.py run --features "$RUSTFS_BUILD_FEATURES" -- cargo nextest run --profile e2e-repl-nightly -p e2e_test
|
||||
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with:
|
||||
profile: e2e-repl-nightly
|
||||
stack: ${{ matrix.stack }}
|
||||
logs: ${{ runner.temp }}/rustfs-e2e-repl-nightly-logs
|
||||
|
||||
- name: Upload nextest junit report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-replication-nightly-junit-${{ github.run_number }}
|
||||
name: e2e-replication-nightly-junit-${{ github.run_number }}-${{ matrix.stack }}
|
||||
path: |
|
||||
target/nextest/e2e-repl-nightly/junit.xml
|
||||
${{ runner.temp }}/rustfs-e2e-repl-nightly-list.json
|
||||
@@ -122,9 +139,12 @@ jobs:
|
||||
|
||||
cluster-nightly:
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
name: Cluster fault e2e (nightly)
|
||||
name: Cluster fault e2e (nightly, ${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 90
|
||||
# The gateway leg is report-only until T2.10.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy: { fail-fast: false, matrix: { stack: [legacy, gateway] } }
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
@@ -145,6 +165,11 @@ jobs:
|
||||
run: |
|
||||
python3 scripts/e2e_binary.py build --bins --features e2e-test-hooks
|
||||
|
||||
# A gateway binary that refuses to start skips the suite; the summary says why.
|
||||
- name: Gateway preflight
|
||||
if: matrix.stack == 'gateway'
|
||||
run: python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/leg/stack.json"
|
||||
|
||||
- name: Verify cluster fault e2e membership
|
||||
env:
|
||||
NEXTEST_LISTING: ${{ runner.temp }}/rustfs-e2e-nightly-list.json
|
||||
@@ -156,13 +181,22 @@ jobs:
|
||||
env:
|
||||
CARGO_BIN_EXE_rustfs: ${{ github.workspace }}/target/debug/rustfs
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-e2e-nightly-logs
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
run: python3 scripts/e2e_binary.py run --features e2e-test-hooks -- cargo nextest run --profile e2e-nightly -p e2e_test
|
||||
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with:
|
||||
profile: e2e-nightly
|
||||
stack: ${{ matrix.stack }}
|
||||
logs: ${{ runner.temp }}/rustfs-e2e-nightly-logs
|
||||
|
||||
- name: Upload cluster fault diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-cluster-nightly-${{ github.run_number }}
|
||||
name: e2e-cluster-nightly-${{ github.run_number }}-${{ matrix.stack }}
|
||||
path: |
|
||||
target/nextest/e2e-nightly/junit.xml
|
||||
${{ runner.temp }}/rustfs-e2e-nightly-list.json
|
||||
@@ -172,12 +206,15 @@ jobs:
|
||||
|
||||
protocols-nightly:
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
name: Protocol e2e (nightly)
|
||||
name: Protocol e2e (nightly, ${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 90
|
||||
# The gateway leg is report-only until T2.10.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy: { fail-fast: false, matrix: { stack: [legacy, gateway] } }
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
RUSTFS_BUILD_FEATURES: ftps,webdav,sftp
|
||||
RUSTFS_BUILD_FEATURES: ${{ matrix.stack == 'gateway' && 'ftps,webdav,sftp,gateway-stack' || 'ftps,webdav,sftp' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
@@ -201,6 +238,11 @@ jobs:
|
||||
- name: Build protocol server
|
||||
run: python3 scripts/e2e_binary.py build --features "$RUSTFS_BUILD_FEATURES"
|
||||
|
||||
# A gateway binary that refuses to start skips the suite; the summary says why.
|
||||
- name: Gateway preflight
|
||||
if: matrix.stack == 'gateway'
|
||||
run: python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/leg/stack.json"
|
||||
|
||||
# The suite owns fixed protocol ports and serializes its internal cases.
|
||||
- name: Verify protocol e2e membership
|
||||
env:
|
||||
@@ -212,16 +254,28 @@ jobs:
|
||||
- name: Run protocol e2e nightly suite
|
||||
env:
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-protocol-e2e-logs
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
# These servers set no log level of their own; the stack proof reads their start-up line.
|
||||
RUST_LOG: rustfs=info
|
||||
# The servers inherit nextest's stdout (--no-capture): keep it where the stack proof reads it.
|
||||
run: |
|
||||
set -o pipefail
|
||||
mkdir -p "$RUSTFS_E2E_LOG_DIR"
|
||||
python3 scripts/e2e_binary.py run --features "$RUSTFS_BUILD_FEATURES" -- cargo nextest run -j 1 --profile e2e-protocols -p e2e_test --no-capture 2>&1 | tee "$RUSTFS_E2E_LOG_DIR/nextest.log"
|
||||
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with:
|
||||
profile: e2e-protocols
|
||||
stack: ${{ matrix.stack }}
|
||||
logs: ${{ runner.temp }}/rustfs-protocol-e2e-logs
|
||||
|
||||
- name: Upload protocol diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-protocol-nightly-${{ github.run_number }}
|
||||
name: e2e-protocol-nightly-${{ github.run_number }}-${{ matrix.stack }}
|
||||
path: |
|
||||
target/nextest/e2e-protocols/junit.xml
|
||||
${{ runner.temp }}/rustfs-e2e-protocols-list.json
|
||||
@@ -229,6 +283,20 @@ jobs:
|
||||
retention-days: 7
|
||||
if-no-files-found: warn
|
||||
|
||||
dual-stack-summary:
|
||||
name: Both-stack diff summary
|
||||
needs: [repl-nightly, cluster-nightly, protocols-nightly]
|
||||
if: github.repository == 'rustfs/rustfs' && always()
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./.github/actions/dual-stack-summary
|
||||
with:
|
||||
profiles: e2e-repl-nightly,e2e-nightly,e2e-protocols
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [repl-nightly, cluster-nightly, protocols-nightly]
|
||||
|
||||
@@ -90,16 +90,11 @@ jobs:
|
||||
- version: 1.0.1
|
||||
asset: rustfs-linux-x86_64-gnu-v1.0.1.zip
|
||||
sha256: 9742e183cb0dfb0d48fa909797af572fe47b7f827569036baa4156e0d3958ee5
|
||||
- version: 1.0.5
|
||||
asset: rustfs-linux-x86_64-gnu-v1.0.5.zip
|
||||
sha256: 5addae2f74756bf80104d0975e6347cda843bc2daffdfcd1f0cb80118b95cbd0
|
||||
revision: 34e6449ed90e3d3a106f6655342e0b3127f33082
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
UPGRADE_SOURCE_VERSION: ${{ matrix.source.version }}
|
||||
UPGRADE_SOURCE_ASSET: ${{ matrix.source.asset }}
|
||||
UPGRADE_SOURCE_SHA256: ${{ matrix.source.sha256 }}
|
||||
UPGRADE_SOURCE_REVISION: ${{ matrix.source.revision }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
@@ -137,13 +132,6 @@ jobs:
|
||||
unzip -q "$archive" -d "$SOURCE_DIR"
|
||||
chmod +x "$SOURCE_DIR/rustfs"
|
||||
test -x "$SOURCE_DIR/rustfs"
|
||||
if [[ -n "$UPGRADE_SOURCE_REVISION" ]]; then
|
||||
mkdir -p "$RUNNER_TEMP/rustfs-upgrade-logs"
|
||||
version_log="$RUNNER_TEMP/rustfs-upgrade-logs/source-version.txt"
|
||||
"$SOURCE_DIR/rustfs" --version | tee "$version_log"
|
||||
grep -Fx "rustfs $UPGRADE_SOURCE_VERSION" "$version_log"
|
||||
grep -Eq "^git commit[[:space:]]*:[[:space:]]*$UPGRADE_SOURCE_REVISION$" "$version_log"
|
||||
fi
|
||||
echo "RUSTFS_UPGRADE_SOURCE_BINARY=$SOURCE_DIR/rustfs" >> "$GITHUB_ENV"
|
||||
echo "RUSTFS_E2E_LOG_DIR=$RUNNER_TEMP/rustfs-upgrade-logs" >> "$GITHUB_ENV"
|
||||
|
||||
@@ -163,14 +151,12 @@ jobs:
|
||||
multipart-layout-upgrade:direct_upgrade_from_previous_release_preserves_multipart_layouts
|
||||
multipart-layout-baseline:previous_release_baseline_replicates_multipart_layouts
|
||||
)
|
||||
case "$UPGRADE_SOURCE_VERSION" in
|
||||
1.0.0-rc.5)
|
||||
cases+=(odm-config-rollback:rc5_rollback_requires_restoring_odm_configuration)
|
||||
cases+=(checkpoint-upgrade:rc5_checkpoint_upgrade_rewinds_signed_progress_without_losing_objects) ;;
|
||||
1.0.1) cases+=(legacy-delete-reservation:stable_upgrade_deletes_foreign_reservations_without_losing_live_objects) ;;
|
||||
1.0.5) ;; # The bucket rollback case also completes an in-flight multipart upload.
|
||||
*) echo "::error::Unknown upgrade source $UPGRADE_SOURCE_VERSION"; exit 1 ;;
|
||||
esac
|
||||
if [[ "$UPGRADE_SOURCE_VERSION" == "1.0.0-rc.5" ]]; then
|
||||
cases+=(odm-config-rollback:rc5_rollback_requires_restoring_odm_configuration)
|
||||
cases+=(checkpoint-upgrade:rc5_checkpoint_upgrade_rewinds_signed_progress_without_losing_objects)
|
||||
else
|
||||
cases+=(legacy-delete-reservation:stable_upgrade_deletes_foreign_reservations_without_losing_live_objects)
|
||||
fi
|
||||
status=0
|
||||
for entry in "${cases[@]}"; do
|
||||
artifact="${entry%%:*}"
|
||||
@@ -192,7 +178,7 @@ jobs:
|
||||
exit "$status"
|
||||
|
||||
- name: Run mixed-version MPU recovery
|
||||
if: ${{ !cancelled() && steps.verify_source.outcome == 'success' && matrix.source.version != '1.0.5' }}
|
||||
if: ${{ !cancelled() && steps.verify_source.outcome == 'success' }}
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
NO_PROXY: 127.0.0.1,localhost,::1
|
||||
@@ -213,24 +199,6 @@ jobs:
|
||||
"$mpu_test" -- --exact --nocapture --test-threads=1 \
|
||||
2>&1 | tee "$RUSTFS_E2E_LOG_DIR/test.log"
|
||||
|
||||
- name: Verify gateway baseline G09 evidence
|
||||
if: ${{ success() && matrix.source.version == '1.0.5' }}
|
||||
shell: bash
|
||||
run: |
|
||||
for field in mixed_version_reader_evidence mixed_version_writer_evidence rollback_payload_evidence; do
|
||||
directory=mixed-version-upgrade
|
||||
if [[ "$field" == rollback_payload_evidence ]]; then directory=bucket-config-rollback; fi
|
||||
jq -e --arg field "$field" --arg current "$GITHUB_SHA" --arg previous "$UPGRADE_SOURCE_REVISION" \
|
||||
'.gate == "G09" and .field == $field and .current_revision == $current and .previous_revision == $previous
|
||||
and ($field != "rollback_payload_evidence" or .rollback_payload_replayed == true)' \
|
||||
"$RUNNER_TEMP/rustfs-upgrade-g09-evidence/$directory/G09-$field.json"
|
||||
done
|
||||
jq -e --arg current "$GITHUB_SHA" --arg previous "$UPGRADE_SOURCE_REVISION" \
|
||||
'.current_revision == $current and .previous_revision == $previous
|
||||
and .part_sizes == [5242880, 5242880, 4096] and .bytes == (.part_sizes | add)
|
||||
and (.rollback_read_sha256 | test("^[a-f0-9]{64}$")) and .rollback_read_sha256 == .roll_forward_read_sha256' \
|
||||
"$RUNNER_TEMP/rustfs-upgrade-g09-evidence/bucket-config-rollback/inflight-multipart-rollback.json"
|
||||
|
||||
- name: Upload scanner/heal G09 evidence
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
|
||||
@@ -15,20 +15,31 @@
|
||||
# Gateway black-box acceptance lanes (rustfs/backlog#2775 T3.4, #2776 T3.5).
|
||||
#
|
||||
# Runs two suites of the rustfs/gateway repository against the candidate binary,
|
||||
# with isolated data and a separate server for each suite:
|
||||
# once per S3 stack (RUSTFS_S3_STACK=legacy and =gateway), one server per stack:
|
||||
#
|
||||
# - the conformance corpus, `--profile rustfs`, judged by
|
||||
# scripts/check_conformance_rulings.py against .config/conformance-rulings.toml
|
||||
# (red: an unruled failure, a ruled case failing differently, a stale ruling,
|
||||
# a skip on the server's own answer);
|
||||
# - the client matrix, ci/compat/run_matrix.sh --external, judged by
|
||||
# - the conformance corpus, `--profile rustfs`. That profile describes the
|
||||
# gateway edge, so scripts/check_conformance_rulings.py judges the gateway
|
||||
# stack against .config/conformance-rulings.toml (red: an unruled failure, a
|
||||
# ruled case failing differently, a stale ruling, a skip on the server's own
|
||||
# answer) and publishes the legacy run as a reference that is never judged:
|
||||
# it only has to serve, stay up and complete;
|
||||
# - the client matrix, ci/compat/run_matrix.sh --external, judged per stack by
|
||||
# scripts/compat_matrix_report.py (no `fail`, no `sut-unregistered`, every
|
||||
# client ran; a client that could not be installed is reported as skipped).
|
||||
# The legacy matrix is the baseline: every cell that passes on legacy must
|
||||
# pass on gateway (`compare`).
|
||||
#
|
||||
# The suites are checked out at the rustfs/gateway rev Cargo.toml pins, so the
|
||||
# suite and the framework under test never drift apart. The verdict is computed
|
||||
# from what the run left on disk (startup record, runner exit code, liveness
|
||||
# after the corpus, report), never from the exit status of an earlier step.
|
||||
# suite and the framework under test never drift apart. The verdict of each
|
||||
# stack is computed from what the run left on disk (startup record, the stack
|
||||
# the server's own log names, runner exit code, liveness after the corpus,
|
||||
# report), never from the exit status of an earlier step. Needs
|
||||
# scripts/dual_stack.py and the `s3_stack` startup field of rustfs/rustfs#9367.
|
||||
#
|
||||
# The gateway stack is report-only until T2.10: its job may fail without failing
|
||||
# the workflow, and its summary says what it observed (did not start, or how many
|
||||
# cases ran, passed, failed and were answered 501). The stack comparison is
|
||||
# report-only for the same reason; its conformance half is information only.
|
||||
#
|
||||
# Not a pull-request gate. Scheduled failures are owned by the scheduled-validation
|
||||
# watchdog (.github/scheduled-validations.json).
|
||||
@@ -64,16 +75,26 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
gateway-rev: ${{ steps.pin.outputs.rev }}
|
||||
ceph-rev: ${{ steps.pin.outputs.ceph-rev }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Read the gateway and Ceph pins
|
||||
- name: Read the rustfs/gateway rev from Cargo.toml
|
||||
id: pin
|
||||
run: python3 scripts/gateway_corpus_capture.py pins >> "$GITHUB_OUTPUT"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
python3 - <<'PY' >> "$GITHUB_OUTPUT"
|
||||
import re, sys, tomllib
|
||||
dependencies = tomllib.load(open("Cargo.toml", "rb"))["workspace"]["dependencies"]
|
||||
revs = {spec.get("rev") for spec in dependencies.values()
|
||||
if isinstance(spec, dict) and spec.get("git") == "https://github.com/rustfs/gateway.git"}
|
||||
if len(revs) != 1 or not re.fullmatch(r"[0-9a-f]{40}", str(next(iter(revs)))):
|
||||
sys.exit(f"Cargo.toml must pin rustfs/gateway at exactly one full rev, found {sorted(map(str, revs))}")
|
||||
print(f"rev={revs.pop()}")
|
||||
PY
|
||||
cat "$GITHUB_OUTPUT"
|
||||
|
||||
build-candidate:
|
||||
name: Build candidate binary
|
||||
@@ -130,8 +151,8 @@ jobs:
|
||||
- name: Build
|
||||
working-directory: gateway
|
||||
run: |
|
||||
cargo build --locked --release -p rustfs-gateway-conformance -p rustfs-gateway-compat-sut -p rustfs-gateway-corpus \
|
||||
--bin rustfs-gateway-conformance --bin compat-sut --bin corpus
|
||||
cargo build --locked --release -p rustfs-gateway-conformance -p rustfs-gateway-compat-sut \
|
||||
--bin rustfs-gateway-conformance --bin compat-sut
|
||||
|
||||
- name: Upload tools
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
@@ -141,23 +162,26 @@ jobs:
|
||||
path: |
|
||||
gateway/target/release/rustfs-gateway-conformance
|
||||
gateway/target/release/compat-sut
|
||||
gateway/target/release/corpus
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
acceptance:
|
||||
name: Acceptance
|
||||
name: ${{ matrix.stack == 'gateway' && 'Acceptance (gateway, report-only until T2.10)' || 'Acceptance (legacy)' }}
|
||||
needs: [ plan, build-candidate, build-gateway-tools ]
|
||||
# GitHub-hosted like the s3-tests targets of reference-parity.yml: the job
|
||||
# only runs prebuilt binaries and the pinned clients, none of which needs Docker.
|
||||
runs-on: ubuntu-latest
|
||||
# About 3x the 15 minutes the job took in run 43325101234 (client install about
|
||||
# About 3x the 15 minutes the legacy job took in run 43325101234 (client install about
|
||||
# 8, matrix about 3, corpus about 3), so a hung server costs 45 runner minutes, not more.
|
||||
timeout-minutes: 45
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
stack: [ legacy, gateway ]
|
||||
env:
|
||||
STACK: ${{ matrix.stack }}
|
||||
ENDPOINT: http://127.0.0.1:9000
|
||||
CONFORMANCE_ENDPOINT: http://127.0.0.1:19000
|
||||
CREATE_BUCKET_ENDPOINT: http://127.0.0.1:19001
|
||||
# The conformance suite signs with these fixed fixture credentials (the AWS
|
||||
# documentation example pair), so the candidate is started with them and the
|
||||
# client matrix is handed the same pair.
|
||||
@@ -189,42 +213,43 @@ jobs:
|
||||
name: gateway-acceptance-tools
|
||||
path: tools
|
||||
|
||||
- name: Start conformance candidate
|
||||
env:
|
||||
# The corpus declares both virtual-host endpoints and a 2 MiB HTTP/2 connection window.
|
||||
ENDPOINT: ${{ env.CONFORMANCE_ENDPOINT }}
|
||||
HOST_DIR: lane
|
||||
RUSTFS_H2_INITIAL_CONN_WINDOW_SIZE: "2097152"
|
||||
RUSTFS_CONSOLE_ENABLE: "false"
|
||||
RUSTFS_SERVER_DOMAINS: s3.example.com,s3.us-east-1.example.com
|
||||
run: &start-candidate |
|
||||
# Records `ready`, or what the process said when it exited, in lane/startup.txt. `ready`
|
||||
# also needs the server's own `server_starting` log event to name the requested stack
|
||||
# (its `s3_stack` field comes from rustfs/rustfs#9367; scripts/dual_stack.py reads it).
|
||||
- name: Start candidate (${{ matrix.stack }} stack)
|
||||
run: |
|
||||
set -uo pipefail
|
||||
chmod +x target/debug/rustfs tools/*
|
||||
mkdir -p "$HOST_DIR" "$RUNNER_TEMP/$HOST_DIR"/data/rustfs{0..3}
|
||||
target/debug/rustfs --version | tee "$HOST_DIR/candidate-version.txt"
|
||||
mkdir -p lane "$RUNNER_TEMP"/data/rustfs{0..3}
|
||||
target/debug/rustfs --version | tee lane/candidate-version.txt
|
||||
# The four directories share the runner's one disk; the bypass is the CI case the
|
||||
# physical-disk guard sanctions (as in mint.yml).
|
||||
RUSTFS_UNSAFE_BYPASS_DISK_CHECK=true RUST_LOG=info target/debug/rustfs --address "${ENDPOINT#http://}" \
|
||||
--access-key "$ACCESS_KEY" --secret-key "$SECRET_KEY" "$RUNNER_TEMP/$HOST_DIR"/data/rustfs{0..3} \
|
||||
> "$HOST_DIR/rustfs.log" 2>&1 &
|
||||
RUSTFS_S3_STACK="$STACK" RUSTFS_UNSAFE_BYPASS_DISK_CHECK=true RUST_LOG=info target/debug/rustfs --address 127.0.0.1:9000 \
|
||||
--access-key "$ACCESS_KEY" --secret-key "$SECRET_KEY" "$RUNNER_TEMP"/data/rustfs{0..3} \
|
||||
> lane/rustfs.log 2>&1 &
|
||||
pid=$!
|
||||
echo "$pid" > "$HOST_DIR/rustfs.pid"
|
||||
echo "$pid" > lane/rustfs.pid
|
||||
# Liveness first: a ready answer counts only while this process is still running.
|
||||
for _ in $(seq 120); do
|
||||
if ! kill -0 "$pid" 2>/dev/null; then
|
||||
status=0
|
||||
wait "$pid" || status=$?
|
||||
echo "did not start: exit ${status}: $(grep -v '^[[:space:]]*$' "$HOST_DIR/rustfs.log" | tail -n 1)" > "$HOST_DIR/startup.txt"
|
||||
cat "$HOST_DIR/startup.txt"
|
||||
echo "did not start: exit ${status}: $(grep -v '^[[:space:]]*$' lane/rustfs.log | tail -n 1)" > lane/startup.txt
|
||||
cat lane/startup.txt
|
||||
exit 1
|
||||
fi
|
||||
if curl -sf "$ENDPOINT/health/ready" >/dev/null; then
|
||||
echo ready > "$HOST_DIR/startup.txt"
|
||||
exit 0
|
||||
if python3 scripts/dual_stack.py stack --expect "$STACK" --out lane/stack.json lane/rustfs.log > /dev/null; then
|
||||
echo ready > lane/startup.txt
|
||||
exit 0
|
||||
fi
|
||||
echo "did not start: stack not observed" > lane/startup.txt
|
||||
cat lane/startup.txt
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "did not start: /health/ready did not answer within 120 seconds" > "$HOST_DIR/startup.txt"
|
||||
echo "did not start: /health/ready did not answer within 120 seconds" > lane/startup.txt
|
||||
exit 1
|
||||
|
||||
# The exit code is data for the judge step, not this step's result.
|
||||
@@ -232,11 +257,10 @@ jobs:
|
||||
run: |
|
||||
set +e
|
||||
tools/rustfs-gateway-conformance run --root gateway/conformance --profile rustfs \
|
||||
--endpoint "$CONFORMANCE_ENDPOINT" --allow-external-fixtures \
|
||||
--endpoint "$ENDPOINT" --allow-external-fixtures \
|
||||
--json lane/report.json > lane/conformance.log 2>&1
|
||||
echo "$?" > lane/runner-exit.txt
|
||||
if kill -0 "$(cat lane/rustfs.pid)" 2>/dev/null; then echo alive; else echo exited; fi > lane/alive-after-conformance.txt
|
||||
kill "$(cat lane/rustfs.pid)" 2>/dev/null || true
|
||||
tail -n 20 lane/conformance.log
|
||||
|
||||
- name: Set up Python
|
||||
@@ -291,11 +315,6 @@ jobs:
|
||||
echo "COMPAT_CLIENTS=$(IFS=,; echo "${installed[*]}")" >> "$GITHUB_ENV"
|
||||
cat ../lane/skipped-clients.txt 2>/dev/null || echo "every pinned client installed"
|
||||
|
||||
- name: Start client matrix candidate with default protocol settings
|
||||
env:
|
||||
HOST_DIR: lane/matrix-host
|
||||
run: *start-candidate
|
||||
|
||||
# The exit code is data for the judge step, not this step's result.
|
||||
- name: Run client matrix (external)
|
||||
working-directory: gateway
|
||||
@@ -314,69 +333,26 @@ jobs:
|
||||
fi
|
||||
echo "$?" > ../lane/matrix-exit.txt
|
||||
|
||||
- name: Start isolated bucket creation candidate
|
||||
id: create_bucket_host
|
||||
env:
|
||||
ENDPOINT: ${{ env.CREATE_BUCKET_ENDPOINT }}
|
||||
HOST_DIR: lane/create-bucket
|
||||
RUSTFS_CONSOLE_ENABLE: "false"
|
||||
RUSTFS_SERVER_DOMAINS: s3.example.com,s3.us-east-1.example.com
|
||||
run: *start-candidate
|
||||
|
||||
- name: Require bucket creation conformance
|
||||
run: |
|
||||
cases=(c-bkt-0001 c-bkt-0010 c-host-0003)
|
||||
status=0
|
||||
for id in "${cases[@]}"; do
|
||||
tools/rustfs-gateway-conformance run --root gateway/conformance --profile rustfs \
|
||||
--filter "$id" --endpoint "$CREATE_BUCKET_ENDPOINT" --allow-external-fixtures --allow-external-writes \
|
||||
--json "lane/create-bucket/$id.json" || status=1
|
||||
done
|
||||
python3 - "$CREATE_BUCKET_ENDPOINT" "${cases[@]}" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
endpoint, *case_ids = sys.argv[1:]
|
||||
for case_id in case_ids:
|
||||
report = json.loads(Path(f"lane/create-bucket/{case_id}.json").read_text())
|
||||
if report.get("endpoint") != endpoint or report.get("profile") != "rustfs":
|
||||
sys.exit(f"{case_id}: report does not identify the requested RustFS endpoint")
|
||||
observed = [(case["id"], case["phase"], case["verdict"]) for case in report["cases"]]
|
||||
if report.get("validate_only") is not False or observed != [(case_id, "execute", "passed")]:
|
||||
sys.exit(f"{case_id}: expected one executed pass, got {observed}, validate_only={report.get('validate_only')}")
|
||||
PY
|
||||
exit "$status"
|
||||
|
||||
- name: Stop bucket creation candidate
|
||||
if: always() && steps.create_bucket_host.outcome != 'skipped'
|
||||
run: |
|
||||
if [[ -f lane/create-bucket/rustfs.pid ]]; then
|
||||
kill "$(cat lane/create-bucket/rustfs.pid)" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Judge and summarize
|
||||
if: always()
|
||||
run: |
|
||||
set -uo pipefail
|
||||
status=0
|
||||
python3 scripts/check_conformance_rulings.py --run-dir lane --case-dir gateway/conformance/cases | tee -a "$GITHUB_STEP_SUMMARY" || status=1
|
||||
python3 scripts/compat_matrix_report.py check --run-dir lane --server-dir lane/matrix-host | tee -a "$GITHUB_STEP_SUMMARY" || status=1
|
||||
python3 scripts/check_conformance_rulings.py --stack "$STACK" --run-dir lane | tee -a "$GITHUB_STEP_SUMMARY" || status=1
|
||||
python3 scripts/compat_matrix_report.py check --stack "$STACK" --run-dir lane | tee -a "$GITHUB_STEP_SUMMARY" || status=1
|
||||
exit "$status"
|
||||
|
||||
- name: Upload lane results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: gateway-acceptance-lane
|
||||
name: gateway-acceptance-lane-${{ matrix.stack }}
|
||||
overwrite: true
|
||||
path: |
|
||||
lane/*.txt
|
||||
lane/*.log
|
||||
lane/matrix-host/*.txt
|
||||
lane/matrix-host/*.log
|
||||
lane/report.json
|
||||
lane/create-bucket/c-*.json
|
||||
lane/stack.json
|
||||
lane/compat/matrix.json
|
||||
lane/compat/probe.jsonl
|
||||
lane/compat/sut.log
|
||||
@@ -384,119 +360,36 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
capture-corpus:
|
||||
name: Capture wire samples (selected E2E and Ceph tests)
|
||||
needs: [ plan, build-gateway-tools ]
|
||||
compare:
|
||||
name: Compare stacks (report-only until T2.10)
|
||||
needs: [ acceptance ]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
timeout-minutes: 10
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Rust environment
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
# Reuse the hosted server and e2e harness dependencies. Capture jobs never save caches.
|
||||
cache-shared-key: ci-e2e-distributed-hosted
|
||||
cache-save-if: 'false'
|
||||
install-build-packaging-tools: 'false'
|
||||
|
||||
# Keep external source and tools outside the verified server's source inventory.
|
||||
- name: Checkout gateway's independent secret scanner
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
repository: rustfs/gateway
|
||||
ref: ${{ needs.plan.outputs.gateway-rev }}
|
||||
path: target/wire/gateway
|
||||
persist-credentials: false
|
||||
|
||||
- name: Checkout pinned Ceph tests
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
repository: ceph/s3-tests
|
||||
ref: ${{ needs.plan.outputs.ceph-rev }}
|
||||
path: target/wire/ceph
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download matching corpus tools
|
||||
- name: Download lane results
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: gateway-acceptance-tools
|
||||
path: target/wire/tools
|
||||
pattern: gateway-acceptance-lane-*
|
||||
path: lanes
|
||||
|
||||
- name: Install Ceph's test dependencies
|
||||
- name: Diff legacy and gateway
|
||||
run: |
|
||||
python3 -m venv "$RUNNER_TEMP/ceph-venv"
|
||||
"$RUNNER_TEMP/ceph-venv/bin/python" -m pip install -r target/wire/ceph/requirements.txt
|
||||
|
||||
- name: Build the debug-only recording server
|
||||
id: wire_server
|
||||
run: python3 scripts/e2e_binary.py build --features corpus-record
|
||||
|
||||
- name: Record and verify selected scenarios from both sources
|
||||
id: capture
|
||||
run: |
|
||||
chmod +x target/wire/tools/corpus
|
||||
python3 scripts/e2e_binary.py run --features corpus-record -- \
|
||||
"$RUNNER_TEMP/ceph-venv/bin/python" scripts/gateway_corpus_capture.py record --suite nightly \
|
||||
--gateway target/wire/gateway --ceph target/wire/ceph --tool target/wire/tools/corpus \
|
||||
--summary "$RUNNER_TEMP/gateway-capture-summary.json"
|
||||
|
||||
- name: Require 1000–2000 retained entries
|
||||
run: python3 scripts/gateway_corpus_capture.py check-size "$RUNNER_TEMP/gateway-capture-summary.json"
|
||||
|
||||
# Only publish after the enclosing binary verifier also succeeds. A size shortfall still has valid counts.
|
||||
- name: Upload validated counts
|
||||
if: ${{ !cancelled() && steps.capture.outcome == 'success' }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: gateway-capture-summary
|
||||
path: ${{ runner.temp }}/gateway-capture-summary.json
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
# The capture size and release parity are independent verdicts.
|
||||
- name: Fetch the verified release reference
|
||||
id: wire_reference
|
||||
if: ${{ !cancelled() && steps.wire_server.outcome == 'success' }}
|
||||
uses: ./.github/actions/reference-binary
|
||||
|
||||
- name: Install a child-process clock for the wire comparison
|
||||
id: wire_clock
|
||||
if: ${{ !cancelled() && steps.wire_reference.outcome == 'success' }}
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install --no-install-recommends -y libfaketime
|
||||
lib="$(dpkg-query -L libfaketime | sed -n '/\/libfaketime\.so\.1$/p')"
|
||||
test -f "$lib"
|
||||
echo "path=$lib" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Compare the same signed Ceph requests against the release
|
||||
id: wire_compare
|
||||
if: ${{ !cancelled() && steps.wire_clock.outcome == 'success' }}
|
||||
env:
|
||||
REF_BINARY: ${{ steps.wire_reference.outputs.path }}
|
||||
REF_SHA256: ${{ steps.wire_reference.outputs.executable-sha256 }}
|
||||
REF_VERSION: ${{ steps.wire_reference.outputs.version }}
|
||||
CLOCK_LIBRARY: ${{ steps.wire_clock.outputs.path }}
|
||||
run: |
|
||||
python3 scripts/e2e_binary.py run --features corpus-record -- \
|
||||
"$RUNNER_TEMP/ceph-venv/bin/python" scripts/gateway_wire_replay.py compare \
|
||||
--ceph target/wire/ceph --gateway target/wire/gateway --reference "$REF_BINARY" \
|
||||
--reference-sha256 "$REF_SHA256" --reference-version "$REF_VERSION" --clock-library "$CLOCK_LIBRARY" \
|
||||
--summary "$RUNNER_TEMP/gateway-wire-differences.json"
|
||||
|
||||
- name: Require zero response differences on replayed cases
|
||||
if: ${{ !cancelled() && steps.wire_compare.outcome == 'success' }}
|
||||
run: python3 scripts/gateway_wire_replay.py check "$RUNNER_TEMP/gateway-wire-differences.json"
|
||||
|
||||
- name: Upload validated difference counts and case IDs
|
||||
if: ${{ !cancelled() && steps.wire_compare.outcome == 'success' }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: gateway-wire-differences
|
||||
path: ${{ runner.temp }}/gateway-wire-differences.json
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
set -uo pipefail
|
||||
status=0
|
||||
{
|
||||
python3 scripts/check_conformance_rulings.py \
|
||||
--diff lanes/gateway-acceptance-lane-legacy lanes/gateway-acceptance-lane-gateway || status=1
|
||||
echo
|
||||
python3 scripts/compat_matrix_report.py diff \
|
||||
--legacy lanes/gateway-acceptance-lane-legacy --gateway lanes/gateway-acceptance-lane-gateway || status=1
|
||||
} > diff.md
|
||||
cat diff.md
|
||||
cat diff.md >> "$GITHUB_STEP_SUMMARY"
|
||||
exit "$status"
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# Copyright 2026 RustFS Team
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Gateway Integration Sync
|
||||
|
||||
# Merges `main` into the long-lived `gateway/integration` branch every weekday
|
||||
# so the s3s -> gateway migration (rustfs/backlog#2734, task T0.1 in #2736)
|
||||
# never accumulates merge debt. A clean merge lands as a `--no-ff` merge commit
|
||||
# pushed straight to the branch. A conflicting merge is aborted and fails the
|
||||
# run after its summary records the source and target SHAs, run URL, and exact
|
||||
# conflicting paths. It creates no sync branch or pull request. Resolve the
|
||||
# merge in an isolated worktree based on the latest target, preserve the
|
||||
# two-parent merge commit, and push only after the required checks pass and the
|
||||
# target still matches the merge's first parent. If the target moves, restart
|
||||
# from its new head.
|
||||
#
|
||||
# Write scope: only `gateway/integration` is ever pushed. The push uses a
|
||||
# one-hour installation token of the organisation's GitHub App (contents:
|
||||
# write) because that app is the only non-admin bypass actor of the
|
||||
# `gateway/integration` ruleset; GITHUB_TOKEN cannot be a ruleset bypass actor,
|
||||
# so it cannot push through the required reviews and checks. GITHUB_TOKEN is
|
||||
# read-only here.
|
||||
#
|
||||
# `schedule` fires only from the default branch, so the cron is live once this
|
||||
# file exists on `main`. `workflow_dispatch` runs from any ref that carries the
|
||||
# file and always acts on `gateway/integration`.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 2 * * 1-5" # Weekdays 02:00 UTC
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source_ref:
|
||||
description: >-
|
||||
Branch to merge into gateway/integration. The schedule always merges
|
||||
main; only the conflict acceptance test (rustfs/backlog#2736) sets
|
||||
another branch.
|
||||
required: false
|
||||
default: main
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
TARGET_BRANCH: gateway/integration
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Merge main into gateway/integration
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Create the branch push token
|
||||
id: push-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
|
||||
with:
|
||||
app-id: ${{ vars.CLA_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CLA_BOT_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: rustfs
|
||||
permission-contents: write
|
||||
|
||||
- name: Checkout gateway/integration
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
# persist-credentials-exempt: this checkout's token IS the push
|
||||
# credential — the merge commit and the sync branch are pushed with it
|
||||
# below. It is a one-hour installation token scoped to contents.
|
||||
ref: gateway/integration
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.push-token.outputs.token }}
|
||||
|
||||
- name: Configure the bot identity
|
||||
run: |
|
||||
git config user.name "rustfs-cla-assistant[bot]"
|
||||
git config user.email "273121464+rustfs-cla-assistant[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Merge the source branch
|
||||
id: merge
|
||||
env:
|
||||
SOURCE_REF: ${{ inputs.source_ref || 'main' }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! [[ "$SOURCE_REF" =~ ^[A-Za-z0-9][A-Za-z0-9._/-]*$ ]] \
|
||||
|| [[ "$SOURCE_REF" == *..* ]] \
|
||||
|| [[ "$SOURCE_REF" == "$TARGET_BRANCH" ]]; then
|
||||
echo "::error::refusing source_ref '${SOURCE_REF}'"
|
||||
exit 1
|
||||
fi
|
||||
git fetch origin "refs/heads/${SOURCE_REF}:refs/remotes/origin/${SOURCE_REF}"
|
||||
source_sha=$(git rev-parse "origin/${SOURCE_REF}")
|
||||
target_sha=$(git rev-parse HEAD)
|
||||
{
|
||||
echo "source_ref=${SOURCE_REF}"
|
||||
echo "source_sha=${source_sha}"
|
||||
echo "target_sha=${target_sha}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
if git merge --no-ff --no-edit "origin/${SOURCE_REF}"; then
|
||||
if [[ "$(git rev-parse HEAD)" == "$target_sha" ]]; then
|
||||
echo "result=up-to-date" >> "$GITHUB_OUTPUT"
|
||||
echo "\`${TARGET_BRANCH}\` already contains \`${SOURCE_REF}\` (${source_sha}); nothing to push." >> "$GITHUB_STEP_SUMMARY"
|
||||
else
|
||||
echo "result=merged" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
conflicts=$(git diff --name-only --diff-filter=U)
|
||||
if [[ -z "$conflicts" ]]; then
|
||||
git merge --abort || true
|
||||
echo "::error::git merge failed without reporting conflicting paths; this is not a conflict"
|
||||
exit 1
|
||||
fi
|
||||
{
|
||||
echo "## Gateway integration sync stopped on conflicts"
|
||||
echo
|
||||
echo "- Run: ${RUN_URL}"
|
||||
echo "- Source: \`${SOURCE_REF}\` at ${source_sha}"
|
||||
echo "- Target: \`${TARGET_BRANCH}\` at ${target_sha}"
|
||||
echo
|
||||
echo "Conflicting files:"
|
||||
printf '%s\n' "$conflicts" | sed 's/^/- /'
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
git merge --abort
|
||||
echo "::error::${SOURCE_REF} cannot be merged cleanly into ${TARGET_BRANCH}; no branch or pull request was created"
|
||||
exit 1
|
||||
|
||||
- name: Push the merge commit
|
||||
if: steps.merge.outputs.result == 'merged'
|
||||
env:
|
||||
SOURCE_REF: ${{ steps.merge.outputs.source_ref }}
|
||||
SOURCE_SHA: ${{ steps.merge.outputs.source_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git push origin HEAD:refs/heads/gateway/integration
|
||||
echo "Merged \`${SOURCE_REF}\` (${SOURCE_SHA}) into \`${TARGET_BRANCH}\` as $(git rev-parse HEAD)." >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [sync]
|
||||
# Same ci-8 mechanism audit.yml and coverage.yml use: a scheduled run that
|
||||
# could not push or encountered merge conflicts must not stay visible only
|
||||
# in the Actions tab.
|
||||
if: github.repository == 'rustfs/rustfs' && (always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure'))
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Open or update failure-tracking issue
|
||||
uses: ./.github/actions/schedule-failure-issue
|
||||
with:
|
||||
github-token: ${{ secrets.BACKLOG_ISSUE_TOKEN }}
|
||||
+138
-275
@@ -12,45 +12,45 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# MinIO Mint dual-stack comparison against RustFS: multi-SDK client compatibility
|
||||
# (rustfs/backlog#2774, T3.3).
|
||||
# MinIO Mint against RustFS: multi-SDK client compatibility.
|
||||
#
|
||||
# ceph/s3-tests (see e2e-s3tests.yml, reference-parity.yml, and the ci.yml PR
|
||||
# gate) exercises S3 API semantics through boto3 only. Mint complements it by
|
||||
# running the functional test suites of many real client SDKs and tools (awscli,
|
||||
# mc, aws-sdk-go-v2/php/ruby, minio-go/java/js/py, s3cmd, versioning, ...),
|
||||
# catching client-specific signing, encoding, and streaming edge cases a single
|
||||
# client cannot.
|
||||
# ceph/s3-tests (see e2e-s3tests.yml and the ci.yml PR gate) exercises the S3
|
||||
# API semantics through boto3 only. Mint complements it by running the
|
||||
# functional test suites of many REAL client SDKs and tools (awscli, mc,
|
||||
# aws-sdk-java/go/php/ruby, minio-go/java/js/py, s3cmd, ...), which catches
|
||||
# client-specific signing, encoding, and streaming edge cases a single client
|
||||
# cannot.
|
||||
#
|
||||
# Dual-stack nightly gate (rustfs/backlog#2774): runs the pinned minio/mint
|
||||
# image against BOTH:
|
||||
# - `legacy`: the pinned reference release in .config/reference-binary.toml,
|
||||
# downloaded and SHA-256 verified by ./.github/actions/reference-binary;
|
||||
# - `gateway`: the candidate binary built from this checkout by
|
||||
# `build-candidate` on `sm-standard-4` (matching `ci.yml` and
|
||||
# `reference-parity.yml`, avoiding release-LTO OOM on 16 GB `ubuntu-latest`).
|
||||
# This job is REPORT-ONLY for test failures: RustFS does not pass every mint
|
||||
# suite yet, so failures are inventoried in the job summary instead of turning
|
||||
# the run red. The job fails only when mint produces no results at all
|
||||
# (infrastructure error). Once a suite passes reliably, tightening this into a
|
||||
# baseline gate (like implemented_tests.txt for s3-tests) is the natural next
|
||||
# step. Tightening this into a per-suite baseline gate is tracked as ci-3
|
||||
# (backlog#1149) and is intentionally NOT done here.
|
||||
#
|
||||
# Both legs build the same lightweight `ubuntu:26.04` runtime image (glibc
|
||||
# >= both `sm-standard-4`'s Ubuntu 24.04 glibc 2.39 and the pinned 1.0.5
|
||||
# reference binary's glibc 2.31), symmetrically bind-mount their verified
|
||||
# binary read-only at `/usr/bin/rustfs`, run on identical Docker bridge
|
||||
# networking (`rustfs-net`, `SERVER_ENDPOINT=rustfs-mint:9000`), and record
|
||||
# verified in-container binary provenance (`target.json`). Individual SDK test
|
||||
# failures within a leg are data for the comparison, not a leg failure; a
|
||||
# missing/empty `log.json` or container startup failure fails the leg. The
|
||||
# `compare` job runs `scripts/mint_stack_diff.py` as a fail-closed gate: it
|
||||
# verifies distinct binary provenance, writes the Markdown
|
||||
# `(sdk, test, legacy, gateway)` diff table to `$GITHUB_STEP_SUMMARY`, uploads
|
||||
# `diff.md`/`diff.json`, and fails whenever the diff table is non-empty or
|
||||
# either leg lacks valid results.
|
||||
# Runner infrastructure (ci-2, backlog#1149): this job needs a working Docker
|
||||
# daemon to (a) build the RustFS source image with buildx and (b) run both the
|
||||
# RustFS server and the mint image. It previously ran on the self-hosted
|
||||
# `sm-standard-4` label, which is served by heterogeneous runners; its single
|
||||
# recorded run (28730530597, 2026-07-05) landed on a minimal pod with no
|
||||
# `/var/run/docker.sock`, so "Enable buildx" died at `docker buildx create`
|
||||
# ("failed to connect to the docker API at unix:///var/run/docker.sock") before
|
||||
# any test executed -- the same root cause ci-1 fixed for the weekly s3-tests
|
||||
# sweep. The fix is to pin to GitHub-hosted `ubuntu-latest`, which reliably
|
||||
# ships a running Docker daemon + buildx + python3, instead of trusting the
|
||||
# drifting self-hosted fleet. Tradeoff: the source Rust build is heavier on a
|
||||
# GitHub-hosted 4-vCPU runner than on a warm self-hosted host, but it stays
|
||||
# well inside the 120-minute budget and buys deterministic infra. The
|
||||
# docker-capable self-hosted `dind-sm-standard-2` label was the alternative but
|
||||
# has fewer cores and reintroduces fleet-state risk for no reliability gain.
|
||||
#
|
||||
# Runner infrastructure (ci-2, backlog#1149; backlog#2774): compiling the RustFS
|
||||
# candidate binary needs no Docker daemon and belongs on `sm-standard-4` (28 GB
|
||||
# RAM, warmed `ci-dev` cache) because the full release LTO `Dockerfile.source`
|
||||
# build OOMs on 16 GB `ubuntu-latest`. Running `rustfs-mint` and `minio/mint`
|
||||
# needs a working Docker daemon without self-hosted pod drift (no
|
||||
# `/var/run/docker.sock` on `sm-standard-*`), so the `mint` matrix stays on
|
||||
# GitHub-hosted `ubuntu-latest`.
|
||||
# Stack dimension (rustfs/backlog#2774, T3.3): one image, run with RUSTFS_S3_STACK=legacy and
|
||||
# =gateway. `compare` (scripts/mint_stack_diff.py) holds the gate that every case legacy passes
|
||||
# passes on gateway with no new failure. The gateway leg and `compare` are report-only until
|
||||
# T2.10. A gateway server that refuses to start stops its leg at "Wait for RustFS ready", before
|
||||
# mint runs; the summary says `skipped: gateway stack refuses startup: <why>`. The stack is read
|
||||
# from the server's own start-up line (scripts/dual_stack.py stack).
|
||||
|
||||
name: mint
|
||||
|
||||
@@ -74,22 +74,19 @@ on:
|
||||
required: false
|
||||
default: ""
|
||||
schedule:
|
||||
# Nightly at 06:41 UTC, clear of the overnight validation lanes
|
||||
# (reference-parity 01:37, e2e-s3tests Sun 02:19, dual-stack-nightly 03:13,
|
||||
# gateway-acceptance 03:29, e2e-nightly 04:29, e2e-distributed 05:53).
|
||||
- cron: "41 6 * * *"
|
||||
# Weekly, after the Sunday s3-tests full sweep (starts 02:00 UTC, up to
|
||||
# 3h) has finished, so the two never contend for the same runner pool.
|
||||
- cron: "41 6 * * 0"
|
||||
|
||||
env:
|
||||
# Matches ci.yml, cache-warm.yml, and reference-parity.yml: these variables
|
||||
# are hashed into the rust-cache key, so build-candidate reads the warmed
|
||||
# ci-dev cache on sm-standard-4.
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
S3_ACCESS_KEY: rustfsadmin-ci
|
||||
S3_SECRET_KEY: rustfssecret-ci
|
||||
S3_REGION: us-east-1
|
||||
|
||||
RUST_LOG: info
|
||||
PLATFORM: linux/amd64
|
||||
BUILDX_CACHE_SCOPE: rustfs-e2e-s3tests-source
|
||||
|
||||
MINT_SUITES: ${{ github.event.inputs.suites || '' }}
|
||||
MINT_MODE: ${{ github.event.inputs.mode || 'core' }}
|
||||
# minio/mint:edge is a rolling tag, so an unpinned run is not reproducible and
|
||||
@@ -106,7 +103,7 @@ env:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name != 'schedule' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Only alert-on-failure needs more than read access; it declares its own
|
||||
# job-level `issues: write`.
|
||||
@@ -118,146 +115,73 @@ defaults:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build-candidate:
|
||||
name: Build candidate binary
|
||||
# Disk, critical-path CPU, and cache ownership: the same debug build as
|
||||
# ci.yml's build-rustfs-debug-binary and reference-parity.yml's
|
||||
# build-candidate, reading the ci-dev cache written on sm-standard-4 (and
|
||||
# avoiding release-LTO OOM on 16 GB ubuntu-latest).
|
||||
runs-on: sm-standard-4
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Rust environment
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
rust-version: stable
|
||||
cache-shared-key: ci-dev-ea7eec74fe14
|
||||
cache-save-if: 'false'
|
||||
install-build-packaging-tools: 'false'
|
||||
install-test-tools: 'false'
|
||||
|
||||
- name: Build debug binary
|
||||
run: python3 scripts/e2e_binary.py build --bins --features e2e-test-hooks
|
||||
|
||||
- name: Upload candidate binary
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: mint-candidate-binary
|
||||
overwrite: true
|
||||
path: |
|
||||
target/debug/rustfs
|
||||
target/debug/rustfs.e2e.json
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
mint:
|
||||
name: mint (${{ matrix.leg }})
|
||||
needs: [build-candidate]
|
||||
# GitHub-hosted: reliably provides a running Docker daemon + python3.
|
||||
# Self-hosted sm-standard-* pods do not provide /var/run/docker.sock.
|
||||
image:
|
||||
name: Build the RustFS image once
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
leg: [legacy, gateway]
|
||||
env:
|
||||
LEG: ${{ matrix.leg }}
|
||||
NO_PROXY: 127.0.0.1,localhost,::1
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Fetch pinned reference binary
|
||||
id: reference
|
||||
if: matrix.leg == 'legacy'
|
||||
uses: ./.github/actions/reference-binary
|
||||
- name: Enable buildx
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
||||
|
||||
- name: Download candidate binary
|
||||
if: matrix.leg == 'gateway'
|
||||
- name: Build RustFS image (source, cached)
|
||||
run: |
|
||||
DOCKER_BUILDKIT=1 docker buildx build --load \
|
||||
--platform "${PLATFORM}" \
|
||||
--cache-from "type=gha,scope=${BUILDX_CACHE_SCOPE}" \
|
||||
--cache-to "type=gha,mode=max,scope=${BUILDX_CACHE_SCOPE}" \
|
||||
-t rustfs-ci \
|
||||
-f Dockerfile.source .
|
||||
docker save rustfs-ci --output "${RUNNER_TEMP}/rustfs-ci.tar"
|
||||
|
||||
- name: Upload the image
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: mint-image
|
||||
path: ${{ runner.temp }}/rustfs-ci.tar
|
||||
retention-days: 1
|
||||
|
||||
mint:
|
||||
name: mint (${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
needs: [image]
|
||||
# Report-only until T2.10: the gateway stack cannot serve the suites yet.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
stack: [legacy, gateway]
|
||||
env:
|
||||
STACK: ${{ matrix.stack }}
|
||||
# GitHub-hosted: reliably provides a running Docker daemon + buildx +
|
||||
# python3. See the header note (ci-2) for why the self-hosted sm-standard-4
|
||||
# label was abandoned (no docker.sock on the pod its only run landed on).
|
||||
# sm-standard-2 has no docker.sock either (weekly runs failed at "Enable
|
||||
# buildx" from 2026-09-27 to 2026-11-08), so keep this job on ubuntu-latest.
|
||||
# TODO(ci-8): scheduled-failure alerting (auto-open issue on a red weekly
|
||||
# run) is added by the ci-8 composite action; do not implement it here.
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download the image
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: mint-candidate-binary
|
||||
path: ${{ runner.temp }}/candidate
|
||||
name: mint-image
|
||||
path: ${{ runner.temp }}
|
||||
|
||||
- name: Build lightweight runtime image
|
||||
run: |
|
||||
set -euo pipefail
|
||||
ctx="${RUNNER_TEMP}/mint-runtime-ctx"
|
||||
rm -rf "${ctx}"
|
||||
mkdir -p "${ctx}"
|
||||
cp entrypoint.sh "${ctx}/entrypoint.sh"
|
||||
cp -R bootstrap "${ctx}/bootstrap"
|
||||
cat > "${ctx}/Dockerfile" <<'EOF'
|
||||
FROM ubuntu:26.04
|
||||
|
||||
RUN set -eux; \
|
||||
export DEBIAN_FRONTEND=noninteractive; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
jq \
|
||||
tzdata \
|
||||
coreutils; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN set -eux; \
|
||||
groupadd -g 10001 rustfs; \
|
||||
useradd -u 10001 -g rustfs -M -s /usr/sbin/nologin rustfs; \
|
||||
mkdir -p /data/.rustfs/events /data/.rustfs/audit /logs /opt/rustfs /app; \
|
||||
ln -s /data/.rustfs/events /opt/rustfs/events; \
|
||||
ln -s /data/.rustfs/audit /opt/rustfs/audit; \
|
||||
chown -R rustfs:rustfs /data /logs /app; \
|
||||
chmod 0750 /data /logs
|
||||
|
||||
WORKDIR /app
|
||||
COPY entrypoint.sh /etc/rustfs/entrypoint.sh
|
||||
COPY bootstrap/ /etc/rustfs/bootstrap/
|
||||
RUN chmod +x /etc/rustfs/entrypoint.sh && \
|
||||
ln -s /etc/rustfs/entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENV RUSTFS_VOLUMES="/data" \
|
||||
RUST_LOG="warn" \
|
||||
RUSTFS_USERNAME="rustfs" \
|
||||
RUSTFS_GROUPNAME="rustfs" \
|
||||
RUSTFS_UID="10001" \
|
||||
RUSTFS_GID="10001"
|
||||
|
||||
EXPOSE 9000
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENTRYPOINT ["/etc/rustfs/entrypoint.sh"]
|
||||
CMD ["/usr/bin/rustfs"]
|
||||
EOF
|
||||
docker build -t rustfs-mint-runtime "${ctx}"
|
||||
- name: Load the image
|
||||
run: docker load --input "${RUNNER_TEMP}/rustfs-ci.tar"
|
||||
|
||||
- name: Start RustFS
|
||||
env:
|
||||
REFERENCE_PATH: ${{ steps.reference.outputs.path }}
|
||||
CANDIDATE_PATH: ${{ runner.temp }}/candidate/rustfs
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker network inspect rustfs-net >/dev/null 2>&1 || docker network create rustfs-net
|
||||
docker rm -f rustfs-mint >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/rustfs-mint
|
||||
mkdir -p /tmp/rustfs-mint
|
||||
case "${LEG}" in
|
||||
legacy) binary_path="${REFERENCE_PATH}" ;;
|
||||
gateway) binary_path="${CANDIDATE_PATH}" ;;
|
||||
*) echo "unknown mint leg: ${LEG}" >&2; exit 1 ;;
|
||||
esac
|
||||
test -f "${binary_path}"
|
||||
chmod 0755 "${binary_path}"
|
||||
test -x "${binary_path}"
|
||||
# The four disks share one physical device on the runner (a single
|
||||
# loopback filesystem), so the local physical-disk-independence guard
|
||||
# would refuse to start. Bypass it — this is the CI use case the guard
|
||||
@@ -270,71 +194,35 @@ jobs:
|
||||
-e RUSTFS_SECRET_KEY="${S3_SECRET_KEY}" \
|
||||
-e RUSTFS_VOLUMES="/data/rustfs{0...3}" \
|
||||
-e RUSTFS_UNSAFE_BYPASS_DISK_CHECK=true \
|
||||
-e RUSTFS_S3_STACK="${STACK}" \
|
||||
-e RUST_LOG=rustfs=info \
|
||||
-v /tmp/rustfs-mint:/data \
|
||||
-v "${binary_path}:/usr/bin/rustfs:ro" \
|
||||
rustfs-mint-runtime
|
||||
rustfs-ci
|
||||
|
||||
- name: Wait for RustFS ready
|
||||
run: |
|
||||
export no_proxy="${NO_PROXY}"
|
||||
for _ in {1..60}; do
|
||||
if curl -sf http://127.0.0.1:9000/health/ready >/dev/null 2>&1; then
|
||||
echo "RustFS (${LEG}) is ready"
|
||||
echo "RustFS is ready"
|
||||
exit 0
|
||||
fi
|
||||
if [ "$(docker inspect -f '{{.State.Running}}' rustfs-mint 2>/dev/null)" != "true" ]; then
|
||||
echo "RustFS (${LEG}) container not running" >&2
|
||||
echo "RustFS container not running" >&2
|
||||
docker logs rustfs-mint || true
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "Health check timed out (${LEG})" >&2
|
||||
echo "Health check timed out" >&2
|
||||
docker logs rustfs-mint || true
|
||||
exit 1
|
||||
|
||||
- name: Record server provenance
|
||||
env:
|
||||
REFERENCE_VERSION: ${{ steps.reference.outputs.version }}
|
||||
REFERENCE_SHA256: ${{ steps.reference.outputs.executable-sha256 }}
|
||||
CANDIDATE_RECEIPT: ${{ runner.temp }}/candidate/rustfs.e2e.json
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p artifacts
|
||||
actual_sha256="$(docker exec rustfs-mint sha256sum /usr/bin/rustfs | awk '{print $1}')"
|
||||
actual_version="$(docker exec rustfs-mint /usr/bin/rustfs --version | tr '\n' ' ' | sed 's/[[:space:]]*$//')"
|
||||
if [[ "${LEG}" == "legacy" ]]; then
|
||||
expected_sha256="${REFERENCE_SHA256}"
|
||||
else
|
||||
expected_sha256="$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1], encoding="utf-8"))["binary_sha256"])' "${CANDIDATE_RECEIPT}")"
|
||||
fi
|
||||
if [[ "${actual_sha256}" != "${expected_sha256}" ]]; then
|
||||
echo "::error::${LEG} container /usr/bin/rustfs sha256 (${actual_sha256}) != verified binary (${expected_sha256})" >&2
|
||||
exit 1
|
||||
fi
|
||||
ACTUAL_SHA256="${actual_sha256}" EXPECTED_SHA256="${expected_sha256}" ACTUAL_VERSION="${actual_version}" python3 - <<'EOF'
|
||||
import json, os, pathlib
|
||||
|
||||
meta = {
|
||||
"leg": os.environ["LEG"],
|
||||
"binary_sha256": os.environ["ACTUAL_SHA256"],
|
||||
"expected_sha256": os.environ["EXPECTED_SHA256"],
|
||||
"version": os.environ["ACTUAL_VERSION"],
|
||||
}
|
||||
if os.environ["LEG"] == "legacy":
|
||||
meta["expected_version"] = os.environ["REFERENCE_VERSION"]
|
||||
out = pathlib.Path("artifacts/target.json")
|
||||
out.write_text(json.dumps(meta, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
||||
print(out.read_text(encoding="utf-8"))
|
||||
EOF
|
||||
|
||||
- name: Run mint
|
||||
run: |
|
||||
mkdir -p artifacts/mint-log
|
||||
# Mint exits non-zero when any SDK test fails; individual failures are
|
||||
# comparison data for the fail-closed diff-table gate in `compare`.
|
||||
# Capture the exit code and verify log.json exists in the next step.
|
||||
# Mint exits non-zero when any test fails; that is inventory here,
|
||||
# not a gate (see header comment). Capture the exit code and let the
|
||||
# summary step decide.
|
||||
set +e
|
||||
# shellcheck disable=SC2086 # MINT_SUITES is intentionally word-split
|
||||
docker run --rm --network rustfs-net \
|
||||
@@ -346,42 +234,36 @@ jobs:
|
||||
-e MINT_MODE=${MINT_MODE} \
|
||||
-v "${PWD}/artifacts/mint-log:/mint/log" \
|
||||
"${MINT_IMAGE}" ${MINT_SUITES}
|
||||
rc=$?
|
||||
echo "MINT_RC=${rc}" >> "$GITHUB_ENV"
|
||||
echo "${rc}" > artifacts/mint-exit-code.txt
|
||||
echo "MINT_RC=$?" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Summarize leg results
|
||||
- name: Summarize results
|
||||
run: |
|
||||
python3 - <<'EOF'
|
||||
import json, os, pathlib, sys
|
||||
from collections import Counter
|
||||
|
||||
leg = os.environ["LEG"]
|
||||
log = pathlib.Path("artifacts/mint-log/log.json")
|
||||
if not log.is_file():
|
||||
print(f"mint ({leg}) produced no log.json - infrastructure failure", file=sys.stderr)
|
||||
print("mint produced no log.json - infrastructure failure", file=sys.stderr)
|
||||
sys.exit(int(os.environ.get("MINT_RC", "1")) or 1)
|
||||
|
||||
per_suite: dict[str, Counter] = {}
|
||||
failures: list[tuple[str, str, str]] = []
|
||||
entries = 0
|
||||
for line in log.read_text(encoding="utf-8").splitlines():
|
||||
line = line.strip()
|
||||
if not line or not line.startswith("{"):
|
||||
if not line:
|
||||
continue
|
||||
try:
|
||||
entry = json.loads(line)
|
||||
except json.JSONDecodeError:
|
||||
continue
|
||||
entry = json.loads(line)
|
||||
entries += 1
|
||||
suite = entry.get("name", "unknown")
|
||||
status = str(entry.get("status", "unknown")).upper()
|
||||
status = entry.get("status", "unknown").upper()
|
||||
per_suite.setdefault(suite, Counter())[status] += 1
|
||||
if status == "FAIL":
|
||||
failures.append((suite, entry.get("function") or "", entry.get("error") or entry.get("message") or ""))
|
||||
failures.append((suite, entry.get("function", ""), entry.get("error") or entry.get("message") or ""))
|
||||
|
||||
if entries == 0:
|
||||
print(f"mint ({leg}) wrote zero JSON test entries - infrastructure failure", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
lines = [f"# Mint results ({leg})", "", "| Suite | Pass | Fail | N/A |", "|-------|------|------|-----|"]
|
||||
lines = ["# Mint results", "", "| Suite | Pass | Fail | N/A |", "|-------|------|------|-----|"]
|
||||
for suite in sorted(per_suite):
|
||||
c = per_suite[suite]
|
||||
lines.append(f"| {suite} | {c.get('PASS', 0)} | {c.get('FAIL', 0)} | {c.get('NA', 0)} |")
|
||||
@@ -393,6 +275,7 @@ jobs:
|
||||
first = err.strip().splitlines()[0] if err.strip() else ""
|
||||
lines.append(f"- `{suite}` / `{func}` {first}")
|
||||
lines.append("")
|
||||
lines.append("_Report-only: failures are inventory, not a gate (see workflow header)._")
|
||||
|
||||
report = "\n".join(lines)
|
||||
print(report)
|
||||
@@ -408,20 +291,22 @@ jobs:
|
||||
mkdir -p artifacts/rustfs-mint
|
||||
docker logs rustfs-mint > artifacts/rustfs-mint/rustfs.log 2>&1 || true
|
||||
|
||||
- name: Upload leg artifacts
|
||||
- name: Prove which stack the server selected
|
||||
if: always()
|
||||
run: python3 scripts/dual_stack.py stack --expect "${STACK}" --out artifacts/stack.json artifacts/rustfs-mint
|
||||
|
||||
- name: Upload artifacts
|
||||
if: always() && env.ACT != 'true'
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: mint-leg-${{ matrix.leg }}
|
||||
overwrite: true
|
||||
name: mint-${{ matrix.stack }}
|
||||
path: artifacts/**
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
compare:
|
||||
name: Compare legacy vs gateway
|
||||
needs: [build-candidate, mint]
|
||||
if: always() && needs.build-candidate.result == 'success'
|
||||
name: Compare stacks (report-only until T2.10)
|
||||
needs: [mint]
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
@@ -429,49 +314,27 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download leg artifacts
|
||||
- name: Download both legs
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: mint-leg-*
|
||||
path: mint-download
|
||||
pattern: mint-{legacy,gateway}
|
||||
path: legs
|
||||
|
||||
- name: Compare mint results (fail-closed diff-table gate)
|
||||
env:
|
||||
MINT_JOB_RESULT: ${{ needs.mint.result }}
|
||||
# A leg that never uploaded leaves no directory: create both so that the
|
||||
# comparison reports "no result" for it instead of failing to find it.
|
||||
- name: Compare the stacks
|
||||
run: |
|
||||
set -uo pipefail
|
||||
mkdir -p mint-diff
|
||||
python3 scripts/mint_stack_diff.py \
|
||||
mint-download/mint-leg-legacy \
|
||||
mint-download/mint-leg-gateway \
|
||||
--require-meta \
|
||||
--markdown mint-diff/diff.md \
|
||||
--json mint-diff/diff.json
|
||||
status=$?
|
||||
if [[ -f mint-diff/diff.md ]]; then
|
||||
cat mint-diff/diff.md >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
if [[ "${MINT_JOB_RESULT}" != "success" ]]; then
|
||||
echo "::error::mint leg job finished with '${MINT_JOB_RESULT}'"
|
||||
if [[ "${status}" -eq 0 ]]; then
|
||||
status=1
|
||||
fi
|
||||
fi
|
||||
exit "${status}"
|
||||
|
||||
- name: Upload diff report
|
||||
if: always() && env.ACT != 'true'
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: mint-diff
|
||||
overwrite: true
|
||||
path: mint-diff/**
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
# The shell runs with -e; the exit status is reported after the summary is written.
|
||||
set +e -u -o pipefail
|
||||
mkdir -p legs/mint-legacy legs/mint-gateway
|
||||
python3 scripts/mint_stack_diff.py legs/mint-legacy legs/mint-gateway | tee report.txt
|
||||
status="${PIPESTATUS[0]}"
|
||||
{ echo '## Mint: gateway versus legacy'; echo; echo '```'; cat report.txt; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
|
||||
exit "$status"
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [build-candidate, mint, compare]
|
||||
needs: [image, mint]
|
||||
# `always()` is required: without it this job is skipped when a needed
|
||||
# job fails. Alerts only for scheduled runs (backlog#1149 ci-8) — manual
|
||||
# dispatch failures are already watched by a human.
|
||||
|
||||
@@ -68,11 +68,14 @@ env:
|
||||
|
||||
jobs:
|
||||
minio-source:
|
||||
name: MinIO source (read-through, list-through, backfill)
|
||||
name: MinIO source (read-through, list-through, backfill, ${{ matrix.stack }}${{ matrix.stack == 'gateway' && ', report-only until T2.10' || '' }})
|
||||
# Keep this scheduled interoperability lane scoped to the upstream repo.
|
||||
if: github.repository == 'rustfs/rustfs'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
# The gateway leg is report-only until T2.10.
|
||||
continue-on-error: ${{ matrix.stack == 'gateway' }}
|
||||
strategy: { fail-fast: false, matrix: { stack: [legacy, gateway] } }
|
||||
env:
|
||||
NO_PROXY: 127.0.0.1,localhost
|
||||
# Fixed credentials of the container this job starts and throws away;
|
||||
@@ -137,6 +140,11 @@ jobs:
|
||||
- name: Build the RustFS binary under test
|
||||
run: python3 scripts/e2e_binary.py build --bins
|
||||
|
||||
# A gateway binary that refuses to start skips the suite; the summary says why.
|
||||
- name: Gateway preflight
|
||||
if: matrix.stack == 'gateway'
|
||||
run: python3 scripts/dual_stack.py preflight --binary target/debug/rustfs --out "$RUNNER_TEMP/leg/stack.json"
|
||||
|
||||
# The lane selects tests by module, so a rename would quietly shrink it.
|
||||
# The committed digest in .config/e2e-odm-interop-selection.txt fails
|
||||
# closed on that.
|
||||
@@ -147,9 +155,18 @@ jobs:
|
||||
|
||||
- name: Run the interop cases against MinIO
|
||||
env:
|
||||
RUSTFS_S3_STACK: ${{ matrix.stack }}
|
||||
RUSTFS_E2E_LOG_DIR: ${{ runner.temp }}/rustfs-e2e-logs
|
||||
run: python3 scripts/e2e_binary.py run -- cargo nextest run --profile e2e-odm-interop -p e2e_test --no-tests=fail
|
||||
|
||||
- name: Prove the stack and upload the leg
|
||||
if: always()
|
||||
uses: ./.github/actions/dual-stack-leg
|
||||
with:
|
||||
profile: e2e-odm-interop
|
||||
stack: ${{ matrix.stack }}
|
||||
logs: ${{ runner.temp }}/rustfs-e2e-logs
|
||||
|
||||
- name: Build the MinIO interop report
|
||||
if: always()
|
||||
uses: ./.github/actions/odm-interop-report
|
||||
@@ -173,7 +190,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: odm-interop-minio-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
name: odm-interop-minio-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.stack }}
|
||||
path: |
|
||||
artifacts/odm-interop/minio
|
||||
target/nextest/e2e-odm-interop/junit.xml
|
||||
@@ -299,6 +316,20 @@ jobs:
|
||||
target/nextest/e2e-odm-interop/junit.xml
|
||||
retention-days: 14
|
||||
|
||||
dual-stack-summary:
|
||||
name: Both-stack diff summary
|
||||
needs: [minio-source]
|
||||
if: github.repository == 'rustfs/rustfs' && always()
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./.github/actions/dual-stack-summary
|
||||
with:
|
||||
profiles: e2e-odm-interop
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [minio-source, cloud-source]
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
name: S3-over-RDMA feature check
|
||||
|
||||
# Compile the optional RDMA features independently. The cuObject tests link
|
||||
# the NVIDIA SDK and exercise the host-side behavior on a CPU runner.
|
||||
# The `nixl` and `cuobject` features are off in every other build, so the code
|
||||
# behind them is compiled nowhere else. This job compiles the `nixl` half on
|
||||
# Linux and runs rustfs-nixl's unit tests; nixl-sys builds through its stub
|
||||
# fallback, so no NIXL SDK is needed.
|
||||
# The cuObject half needs the NVIDIA cuObject SDK and is not compiled here.
|
||||
# Not a required check and not part of the `Test and Lint` aggregate.
|
||||
|
||||
on:
|
||||
@@ -9,7 +12,6 @@ on:
|
||||
paths:
|
||||
- "crates/nixl/**"
|
||||
- "crates/cuobject/**"
|
||||
- "crates/cuobject-sys/**"
|
||||
- "rustfs/src/storage/rpc/nixl*"
|
||||
- "rustfs/src/app/object/cuobject.rs"
|
||||
- "rustfs/src/app/object/get.rs"
|
||||
@@ -66,44 +68,11 @@ jobs:
|
||||
# These unit tests use a fake sysfs and plain host memory; none needs an
|
||||
# RDMA device or the NIXL libraries.
|
||||
- name: Run the rustfs-nixl unit tests
|
||||
run: cargo test --locked -p rustfs-nixl --features client-http
|
||||
|
||||
cuobject-check:
|
||||
name: cuObject server SDK and unit tests
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
rust-version: stable
|
||||
cache-shared-key: ci-feat-cuobject
|
||||
cache-save-if: 'false'
|
||||
install-build-packaging-tools: 'false'
|
||||
- name: Check the cuObject crates without the NVIDIA SDK
|
||||
run: cargo check --locked -p rustfs-cuobject -p rustfs-cuobject-sys
|
||||
- name: Install the NVIDIA server SDK
|
||||
working-directory: ${{ runner.temp }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends -y libibverbs-dev librdmacm-dev
|
||||
repo=https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64
|
||||
for pkg in libcuobjserver libcuobjserver-dev; do
|
||||
curl --fail --location --retry 3 "$repo/${pkg}_2.1.0.101-1_amd64.deb" -o "$pkg.deb"
|
||||
done
|
||||
sha256sum --check <<'DIGESTS'
|
||||
39e6271118717e8e726233ae5ac29ee3b83e335e1fbe96b097bb458a4a52393a libcuobjserver.deb
|
||||
73d4f187e58b784c7cf64633d7e76c2ac59dea5b475fd981cc6897c34cb9876f libcuobjserver-dev.deb
|
||||
DIGESTS
|
||||
sudo dpkg -i libcuobjserver.deb libcuobjserver-dev.deb
|
||||
- name: Test the server bridge
|
||||
run: cargo test --locked -p rustfs-cuobject --features server
|
||||
run: cargo test --locked -p rustfs-nixl --features sys
|
||||
|
||||
alert-on-failure:
|
||||
name: Alert on scheduled failure
|
||||
needs: [nixl-check, cuobject-check]
|
||||
needs: [nixl-check]
|
||||
# Only scheduled runs open or update the tracking issue; pull-request and
|
||||
# manual runs stay quiet.
|
||||
if: always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure')
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
#
|
||||
# The `differential` job adds the 73-operation dual-stack differential
|
||||
# (crates/e2e_test/src/dual_stack_differential, rustfs/backlog#2740) against the
|
||||
# same pinned reference: side A is the released binary (RUSTFS_E2E_REFERENCE_BINARY),
|
||||
# side B is the candidate built above.
|
||||
# It reuses the candidate build artifact, never builds the candidate
|
||||
# same pinned reference: side A is the released binary (RUSTFS_E2E_REFERENCE_BINARY,
|
||||
# started without RUSTFS_S3_STACK), side B is the candidate built above on its
|
||||
# legacy stack. It reuses the candidate build artifact, never builds the candidate
|
||||
# twice, and prints reference_side, version_a and version_b from the report the test
|
||||
# wrote; it fails when side A was not the reference or both sides report the same
|
||||
# version. Every (op, field, a, b) difference goes to the job summary. Report-only
|
||||
@@ -56,7 +56,6 @@ on:
|
||||
- "scripts/s3-tests/reference_parity.py"
|
||||
- "scripts/junit_diff.py"
|
||||
- "crates/e2e_test/src/dual_stack_differential/**"
|
||||
- "crates/gateway-adapter/tests/fixtures/observability-contract.json"
|
||||
schedule:
|
||||
- cron: "37 1 * * *"
|
||||
workflow_dispatch:
|
||||
@@ -311,7 +310,7 @@ jobs:
|
||||
chmod +x target/debug/rustfs
|
||||
test -x "$REFERENCE_PATH"
|
||||
mkdir -p "$RUSTFS_E2E_LOG_DIR"
|
||||
# Side A: the released binary. Side B: the candidate.
|
||||
# Side A: the released binary. Side B: the candidate on its legacy stack.
|
||||
export RUSTFS_E2E_REFERENCE_BINARY="$REFERENCE_PATH"
|
||||
test_name='dual_stack_differential::tests::both_stacks_answer_every_operation_identically'
|
||||
python3 scripts/e2e_binary.py run --features e2e-test-hooks -- \
|
||||
@@ -390,24 +389,6 @@ jobs:
|
||||
echo "::error::the dual-stack differential failed; see the job summary for every (op, field, a, b)"
|
||||
exit 1
|
||||
|
||||
- name: Verify observability and middleware on the pinned reference and candidate
|
||||
if: ${{ !cancelled() && (steps.differential.outcome == 'success' || steps.differential.outcome == 'failure') }}
|
||||
env:
|
||||
RUSTFS_E2E_REFERENCE_BINARY: ${{ steps.reference.outputs.path }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export no_proxy="$NO_PROXY"
|
||||
test -x "$RUSTFS_E2E_REFERENCE_BINARY"
|
||||
failed=0
|
||||
for contract in observability middleware; do
|
||||
for side in reference current; do
|
||||
name="dual_stack_differential::${contract}_contract::${side}_${contract}_contract"
|
||||
python3 scripts/e2e_binary.py run --features e2e-test-hooks -- \
|
||||
cargo nextest run --locked -p e2e_test --lib --no-tests fail -E "test(=$name)" || failed=1
|
||||
done
|
||||
done
|
||||
exit "$failed"
|
||||
|
||||
compare:
|
||||
name: Compare targets
|
||||
needs: [ plan, s3tests ]
|
||||
|
||||
@@ -80,18 +80,6 @@ Do not commit one-shot plans, trackers, migration ledgers, benchmark snapshots,
|
||||
|
||||
Select checks from the final task-owned diff. Scoped `AGENTS.md` files may add a concrete path-specific check, but must not replace this tiering with a generic full-workspace gate.
|
||||
|
||||
### Issue Fixes and External Regression Coverage
|
||||
|
||||
After fixing a bug tracked by an issue and running the applicable local checks, ask the developer once per fixed issue whether to cover it in [rustfs/auto-testing](https://github.com/rustfs/auto-testing). Ask before opening or updating the fix PR, or before reporting completion if there is no PR. Reuse a choice already made for that fix. Investigation alone and documentation-only changes do not trigger this prompt.
|
||||
|
||||
When presenting the three choices, describe the failing scenario and the assertion that would catch it.
|
||||
|
||||
- **Add or extend a case.** Prefer extending an existing scenario when it can exercise the regression. Record the resulting case ID or auto-testing PR link.
|
||||
- **Already covered.** Cite the existing auto-testing case ID or path and the assertion that would catch this bug.
|
||||
- **Skip.** Record the developer's one-line reason and continue with the fix.
|
||||
|
||||
Record the choice in the PR's Verification section or in the completion report for work without a PR. All three choices retain the applicable RustFS verification requirements below.
|
||||
|
||||
### Documentation and Instructions
|
||||
|
||||
For prose, comments, agent instructions, and skill metadata that cannot affect runtime/build output:
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ refactors.
|
||||
|--------|--------------------------|----------------|
|
||||
| Foundation | `checksums`, `common`, `config`, `data-usage`, `heal-contracts`, `scanner-metrics`, `utils` | Shared configuration, data-usage models, heal domain contracts, scanner telemetry types, utilities, and checksums. |
|
||||
| I/O and storage | `concurrency`, `ecstore`, `filemeta`, `heal`, `io-core`, `io-metrics`, `lifecycle`, `lock`, `object-capacity`, `object-data-cache`, `replication`, `rio`, `rio-v2`, `s3-client`, `scanner`, `storage-api` | Erasure-coded object storage, metadata, recovery, lifecycle, replication, locking, cache, I/O pipelines, and the engine-side S3 client for remote tier/transition targets. |
|
||||
| Security and identity | `credentials`, `crypto`, `iam`, `keystone`, `kms`, `policy`, `security-governance`, `signer`, `sse`, `tls-runtime`, `trusted-proxies` | Credentials, authentication, authorization, encryption, key management, server-side encryption key resolution, TLS, and security contracts. |
|
||||
| Security and identity | `credentials`, `crypto`, `iam`, `keystone`, `kms`, `policy`, `security-governance`, `signer`, `tls-runtime`, `trusted-proxies` | Credentials, authentication, authorization, encryption, key management, TLS, and security contracts. |
|
||||
| Protocols and contracts | `extension-schema`, `madmin`, `protos`, `protocols`, `s3-ops`, `s3-types`, `s3select-api`, `s3select-query` | Admin, inter-node, S3, S3 Select, and optional protocol contracts. |
|
||||
| Operations and integration | `audit`, `notify`, `obs`, `targets`, `zip` | Auditing, observability, event delivery, notification targets, and archive support. |
|
||||
| Test support | `e2e_test`, `test-utils` | End-to-end validation and shared test bootstrap utilities. |
|
||||
|
||||
@@ -13,8 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Deployment
|
||||
|
||||
- **The S3 protocol stack is now rustfs/gateway**, and it is the only S3 stack. The legacy s3s-based stack is removed, and so are the `RUSTFS_S3_STACK` environment variable and the `gateway-stack` cargo feature. There is no on-disk format change. `RUSTFS_S3_STACK` no longer selects anything: a server started with it set, to any value, refuses to start and prints `RUSTFS_S3_STACK is no longer supported; the gateway stack is the only S3 stack since <version>`, where `<version>` is the release's version. Remove the variable from service units, container environments, Helm values and orchestration files before upgrading. To roll back, follow the [S3 stack rollback procedure](docs/operations/s3-stack-rollback.md).
|
||||
|
||||
- Before upgrading, verify that the configured root access key is at least 3 bytes and the root secret key is at least 8 bytes. RustFS now rejects shorter values at startup and identifies the setting to update. Version 1.0.5 accepted these settings at startup and returned HTTP 500 when root requested STS credentials. Coordinate root credential changes across all nodes and clients. See [root credential rotation considerations](docs/operations/two-factor-auth.md#root-credentials-cannot-be-changed-at-runtime).
|
||||
|
||||
- Existing volumes created by older root-running container images must be writable by the non-root runtime identity before upgrading. The default container UID/GID is `10001:10001`; stop the affected instances, verify host mount paths, and for ordinary bind mounts run `sudo chown -R 10001:10001 /actual/data /actual/logs` on each RustFS data/log mount. Account for ACLs, NFS, Kubernetes, and rootless UID mappings. Image-build ownership changes do not migrate mounted data. See the Docker Quick Start in [README.md](README.md).
|
||||
@@ -46,8 +44,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- **SSE-C multipart and copy responses no longer carry `x-amz-server-side-encryption`**: `CreateMultipartUpload`, `UploadPart`, `UploadPartCopy` and `CompleteMultipartUpload` on an SSE-C upload, and `CopyObject` to an SSE-C destination, answered with `x-amz-server-side-encryption: AES256` next to the customer-key headers, so a client reading the response saw an SSE-S3 object. They now return only `x-amz-server-side-encryption-customer-algorithm` and `x-amz-server-side-encryption-customer-key-MD5`, as `PutObject`, `GetObject` and `HeadObject` already did. SSE-S3 and SSE-KMS responses are unchanged.
|
||||
|
||||
- **Vault KMS backends no longer fail when the server answers reads from a replica**: a Vault or OpenBao node that serves reads locally (an OpenBao standby, a Vault Enterprise performance standby) can return the state from before a write for a short while after acknowledging it. Against such a node the KV2 backend failed every key creation with `404 Key not found` while leaving the key stored without its description and tags, failed operations issued right after a create or update with `Key not found` or `Concurrent modification`, and the Transit backend failed a disable followed quickly by an enable. Key creation on the KV2 backend is now a single create-only write that carries the description and tags. Both backends now re-read a key record when the answer is older than a write the same RustFS node made in the previous five seconds, pause before re-reading after a lost check-and-set write and allow five attempts instead of three, and retry a Transit key delete that is refused because the deletion switch is not visible yet. A different RustFS node reading the same replica can still observe the earlier state until the replica catches up; see [OpenBao as the Vault KMS backend](docs/operations/kms-openbao-compatibility.md).
|
||||
|
||||
- **KMS keys could not be described by ARN through the path route**: `GET /rustfs/admin/v3/kms/keys/{key_id}` read the path segment verbatim, so a key id that has to be percent-encoded to fit in one segment — an AWS key ARN, with its `:` and `/` — was looked up, authorized and audited under its encoded spelling and answered `404`. The segment is now percent-decoded first; a segment that is not valid UTF-8 after decoding is refused with `400 InvalidArgument`. The `describe-key?keyId=` form was unaffected.
|
||||
@@ -118,7 +114,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Four-layer regression-prevention tests guard against silent feature deletion: compile-time module assertion, module-presence unit test, cross-module `Protocol` enum assertion, end-to-end SSH banner test against the running binary
|
||||
|
||||
### Changed
|
||||
- **Startup reports the state of `RUSTFS_SSE_S3_MASTER_KEY`**: the server now checks the local SSE-S3 master key when it starts and logs one `sse_local_master_key` event with `state` `loaded`, `not_set`, or `invalid`. An unusable value used to surface only as a `400 InvalidRequest` on the first SSE-S3 request served without a KMS; it is now logged as an error at startup with the reason. Startup still succeeds and request behavior is unchanged. The line "Using RUSTFS_SSE_S3_MASTER_KEY for SSE-S3 (KMS not configured)", logged when the key was first used, is replaced by this event.
|
||||
- **Scanner bucket walkers are no longer tied to the disk count**: a new scanner key `walkers_per_disk` (`RUSTFS_SCANNER_WALKERS_PER_DISK`, `1` through `16`, default `1`) spawns that many bucket walkers per local disk of an erasure set, so a single-disk deployment can walk several buckets at once instead of one bucket, one object at a time. The walkers of one disk share its scanner admission, so a peer still sees one scan session per physical disk, and remote disks keep one walker. The walker count is what `max_concurrent_disk_scans` caps and the disk count stays the floor; the `disk_concurrency_budget` log line now reports `walkers_per_disk`, `walkers`, and the `reason` for the effective limit. The default keeps today's I/O profile because a local disk cannot yet report whether it is rotational; the design intends a higher default on flash once it can (`docs/architecture/scanner-per-bucket-convergence.md`). As groundwork for pacing, the raw-enumeration page writer inserts into its building page in place and commits pages without copying them, and a regression test pins the cost of recording 20,000 entries in one prefix so the quadratic bookkeeping removed by [#8114](https://github.com/rustfs/rustfs/pull/8114) (rustfs#8113) cannot return. No persisted format, protocol or admin API changes beyond the additional config key, which older releases preserve and ignore.
|
||||
- **Encryption and KMS work merged since `1.0.0-rc.5`** (entries were missing from this section):
|
||||
- **Persisted KMS configuration secrets** are sealed field-by-field with `RUSTFS_KMS_CONFIG_SECRET`. **When the variable is unset the secrets are persisted in cleartext and the server only warns** (`persisted KMS configuration carries cleartext secrets`); it never refuses the write. Set it, identically, on every node, and re-save the configuration to seal an existing one.
|
||||
|
||||
Generated
+570
-798
File diff suppressed because it is too large
Load Diff
+54
-61
@@ -23,7 +23,6 @@ members = [
|
||||
"crates/connect-symbol-catalog", # Release-only CPU profile symbol catalog generator
|
||||
"crates/credentials", # Credential management system
|
||||
"crates/crypto", # Cryptography and security features
|
||||
"crates/cuobject-sys", # Native NVIDIA cuObject server SDK bindings
|
||||
"crates/cuobject", # NVIDIA cuObject S3-over-RDMA staging and transfers (optional)
|
||||
"crates/nixl", # NIXL/UCX S3-over-RDMA server side (optional)
|
||||
"crates/ecstore", # Erasure coding storage implementation
|
||||
@@ -61,7 +60,6 @@ members = [
|
||||
"crates/security-governance", # Security governance contracts
|
||||
"crates/extension-schema", # Extension schema contracts
|
||||
"crates/signer", # client signer
|
||||
"crates/sse", # S3 server-side encryption key resolution and metadata
|
||||
"crates/storage-api", # Storage API contracts
|
||||
"crates/test-utils", # Shared test bootstrap helpers (dev-dependency only)
|
||||
"crates/targets", # Target-specific configurations and utilities
|
||||
@@ -73,7 +71,6 @@ members = [
|
||||
"crates/zip", # ZIP file handling and compression
|
||||
"crates/zstd-compat", # Fixed codec for dependencies requiring zstd 0.13
|
||||
]
|
||||
exclude = ["vendor/hyper"]
|
||||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
@@ -110,7 +107,6 @@ rustfs-concurrency = { path = "./crates/concurrency", version = "1.0.5" }
|
||||
rustfs-credentials = { path = "crates/credentials", version = "1.0.5" }
|
||||
rustfs-crypto = { path = "crates/crypto", version = "1.0.5" }
|
||||
rustfs-cuobject = { path = "crates/cuobject", version = "1.0.5" }
|
||||
rustfs-cuobject-sys = { path = "crates/cuobject-sys", version = "1.0.5" }
|
||||
rustfs-nixl = { path = "crates/nixl", version = "1.0.5" }
|
||||
rustfs-ecstore = { path = "crates/ecstore", version = "1.0.5" }
|
||||
rustfs-filemeta = { path = "crates/filemeta", version = "1.0.5" }
|
||||
@@ -143,7 +139,6 @@ rustfs-scanner = { path = "crates/scanner", version = "1.0.5" }
|
||||
rustfs-security-governance = { path = "crates/security-governance", version = "1.0.5" }
|
||||
rustfs-extension-schema = { path = "crates/extension-schema", version = "1.0.5" }
|
||||
rustfs-signer = { path = "crates/signer", version = "1.0.5" }
|
||||
rustfs-sse = { path = "crates/sse", version = "1.0.5" }
|
||||
rustfs-storage-api = { path = "crates/storage-api", version = "1.0.5" }
|
||||
rustfs-trusted-proxies = { path = "crates/trusted-proxies", version = "1.0.5" }
|
||||
rustfs-targets = { path = "crates/targets", version = "1.0.5" }
|
||||
@@ -152,18 +147,18 @@ rustfs-tls-runtime = { path = "crates/tls-runtime", version = "1.0.5" }
|
||||
rustfs-utils = { path = "crates/utils", version = "1.0.5" }
|
||||
rustfs-zip = { path = "./crates/zip", version = "1.0.5" }
|
||||
|
||||
# Pin the gateway and its protocol crates to the same revision.
|
||||
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.42.0", default-features = false }
|
||||
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.2.0", default-features = false }
|
||||
# The gateway's S3 types: the DTOs and persisted bucket-configuration codecs the
|
||||
# engine crates move onto from s3s (rustfs/backlog#2745). The one pin of the
|
||||
# gateway in this workspace; no crate may enable a `compat-s3s*` feature except
|
||||
# the s3s-facing edge of the rustfs binary.
|
||||
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "2a6b8d1f7663db978d8784ab3ea331cade19237b", version = "0.40.0", default-features = false }
|
||||
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "2a6b8d1f7663db978d8784ab3ea331cade19237b", version = "0.2.0", default-features = false }
|
||||
# The gateway framework itself, consumed for its extension traits by the ring-2
|
||||
# adapter. `default-features = false` keeps the `server` feature, and with it the
|
||||
# server crate, out of the build.
|
||||
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.67.0", default-features = false }
|
||||
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "2a6b8d1f7663db978d8784ab3ea331cade19237b", version = "0.63.0", default-features = false }
|
||||
# Test-only: builds the `EffectiveHost` a host-resolution test queries with.
|
||||
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", default-features = false }
|
||||
rustfs-gateway-core = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.64.0", default-features = false }
|
||||
rustfs-gateway-corpus-recorder = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.1.0", default-features = false }
|
||||
rustfs-gateway-dialect-rustfs-admin = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.13.0", default-features = false }
|
||||
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "2a6b8d1f7663db978d8784ab3ea331cade19237b", default-features = false }
|
||||
|
||||
# Async Runtime and Networking
|
||||
async-channel = "2.5.0"
|
||||
@@ -171,15 +166,15 @@ async_zip = { default-features = false, version = "0.0.19" }
|
||||
mysql_async = { default-features = false, version = "0.37.1" }
|
||||
async-compression = { version = "0.4.52" }
|
||||
async-trait = "0.1.92"
|
||||
async-nats = { version = "0.53.0", default-features = false }
|
||||
async-nats = { version = "0.52.0", default-features = false }
|
||||
axum = "0.8.9"
|
||||
futures = "0.3.34"
|
||||
futures-core = "0.3.34"
|
||||
futures-lite = "2.6.1"
|
||||
futures-util = "0.3.34"
|
||||
pollster = "1.0.3"
|
||||
pollster = "1.0.1"
|
||||
pulsar = { default-features = false, version = "=6.9.0" }
|
||||
lapin = { default-features = false, version = "4.13.0" }
|
||||
lapin = { default-features = false, version = "4.12.3" }
|
||||
hyper = { version = "1.12.0" }
|
||||
h2 = { version = "0.4.20" }
|
||||
hyper-rustls = { default-features = false, version = "0.27.10" }
|
||||
@@ -191,7 +186,6 @@ memchr = "2.8.3"
|
||||
minlz = "1.2.3"
|
||||
reqwest = "0.13.5"
|
||||
rustfs-kafka-async = { version = "1.4.1" }
|
||||
slab = { version = "0.4.12" }
|
||||
socket2 = { version = "0.6.5" }
|
||||
tokio = { version = "1.54.1" }
|
||||
tokio-rustls = { default-features = false, version = "0.26.6" }
|
||||
@@ -212,19 +206,18 @@ quinn = { version = "0.11.12", default-features = false, features = [
|
||||
] }
|
||||
|
||||
# Serialization and Data Formats
|
||||
apache-avro = { version = "0.23.0", features = ["snappy", "zstandard"] }
|
||||
bytes = { version = "1.12.2" }
|
||||
apache-avro = { version = "0.22.0", features = ["snappy", "zstandard"] }
|
||||
bytes = { version = "1.12.1" }
|
||||
csv-core = "0.1.13"
|
||||
bytesize = "2.7.0"
|
||||
byteorder = "1.5.0"
|
||||
flatbuffers = "25.12.19"
|
||||
form_urlencoded = "1.2.3"
|
||||
form_urlencoded = "1.2.2"
|
||||
prost = "0.14.6"
|
||||
quick-xml = "0.42.0"
|
||||
rmp = { version = "0.8.15" }
|
||||
rmp-serde = { version = "1.3.1" }
|
||||
serde = { version = "1.0.229" }
|
||||
serde-value = "0.7.0"
|
||||
serde_ignored = { version = "0.1" }
|
||||
serde_with = { version = "3", default-features = false, features = ["macros", "std"] }
|
||||
serde_json = { version = "1.0.154" }
|
||||
@@ -246,7 +239,7 @@ jsonwebtoken = { version = "12.0.0" }
|
||||
openidconnect = { default-features = false, version = "4.1.0" }
|
||||
pbkdf2 = "0.13.0"
|
||||
p256 = { version = "0.14.0", features = ["ecdsa", "pkcs8"] }
|
||||
rsa = { version = "0.10.0", features = ["pkcs1v15"] }
|
||||
rsa = { version = "=0.10.0-rc.18" }
|
||||
rustls = { default-features = false, version = "0.23.46" }
|
||||
rustls-native-certs = "0.8"
|
||||
rustls-pki-types = "1.16.0"
|
||||
@@ -254,13 +247,13 @@ x509-parser = "0.18.1"
|
||||
sha1 = "0.11.0"
|
||||
sha2 = "0.11.1"
|
||||
subtle = "2.6"
|
||||
zeroize = { version = "1.9.2" }
|
||||
zeroize = { version = "1.9.1" }
|
||||
proptest = "1"
|
||||
|
||||
# Time and Date
|
||||
chrono = { version = "0.4.45" }
|
||||
humantime = "2.4.0"
|
||||
jiff = { version = "1.0.2" }
|
||||
jiff = { version = "0.2.43" }
|
||||
time = { version = "0.3.55" }
|
||||
|
||||
# Database
|
||||
@@ -277,18 +270,18 @@ tar-codec = "0.0.16"
|
||||
tar-framing = "0.0.16"
|
||||
atoi = "3.1.1"
|
||||
atomic_enum = "0.3.0"
|
||||
aws-config = { version = "1.13.3" }
|
||||
aws-config = { version = "1.13.2" }
|
||||
aws-credential-types = { version = "1.3.1" }
|
||||
aws-sdk-kms = { default-features = false, version = "1.133.0" }
|
||||
aws-sdk-s3 = { default-features = false, version = "1.161.0" }
|
||||
aws-sdk-sts = { default-features = false, version = "1.128.0" }
|
||||
aws-sdk-kms = { default-features = false, version = "1.131.0" }
|
||||
aws-sdk-s3 = { default-features = false, version = "1.159.0" }
|
||||
aws-sdk-sts = { default-features = false, version = "1.126.0" }
|
||||
aws-smithy-async = { version = "1.3.1" }
|
||||
aws-smithy-http-client = { default-features = false, version = "1.5.3" }
|
||||
aws-smithy-runtime-api = { version = "1.22.0" }
|
||||
aws-smithy-http-client = { default-features = false, version = "1.5.2" }
|
||||
aws-smithy-runtime-api = { version = "1.21.0" }
|
||||
aws-smithy-types = { version = "1.9.4" }
|
||||
base64-simd = "0.8.0"
|
||||
brotli = "9.1.3"
|
||||
clap = { version = "4.6.9" }
|
||||
brotli = "9.1.1"
|
||||
clap = { version = "4.6.7" }
|
||||
const-str = { version = "1.1.0" }
|
||||
convert_case = "0.12.0"
|
||||
criterion = { version = "0.8" }
|
||||
@@ -296,16 +289,16 @@ crossbeam-queue = "0.3.14"
|
||||
crossbeam-channel = "0.5.17"
|
||||
crossbeam-deque = "0.8.8"
|
||||
crossbeam-utils = "0.8.23"
|
||||
datafusion = { default-features = false, version = "55.3.0" }
|
||||
datafusion = { default-features = false, version = "55.2.0" }
|
||||
derive_builder = "0.20.2"
|
||||
ed25519-dalek = "3.0.0"
|
||||
enumset = "1.1.15"
|
||||
faster-hex = "2.0.0"
|
||||
faster-hex = "1.0.0"
|
||||
flate2 = "1.1.11"
|
||||
glob = "0.3.4"
|
||||
google-cloud-storage = "1.22.0"
|
||||
google-cloud-auth = "1.19.0"
|
||||
hashbrown = { version = "0.17.2" }
|
||||
hashbrown = { version = "0.17.1" }
|
||||
# Base32 for RFC 6238 TOTP shared secrets (RFC 4648 unpadded, the alphabet
|
||||
# every authenticator app expects). Already in the graph transitively.
|
||||
data-encoding = "2.11.1"
|
||||
@@ -315,15 +308,14 @@ hostname = "0.4.2"
|
||||
ipnetwork = { version = "0.21.1" }
|
||||
lazy_static = "1.5.1"
|
||||
libc = "0.2.191"
|
||||
cxx = "1"
|
||||
cxx-build = "1"
|
||||
cuobject = "0.1.0"
|
||||
libsystemd = "0.7.2"
|
||||
local-ip-address = "0.6.13"
|
||||
log = "0.4"
|
||||
memmap2 = "0.9.12"
|
||||
nixl-sys = { git = "https://github.com/houseme/nixl", rev = "cc636c83f13d692e85b67e55aed092413d16fb41" }
|
||||
lz4 = "1.28.1"
|
||||
lz4_flex = { version = "0.14.2", default-features = false, features = ["std", "frame"] }
|
||||
lz4_flex = { version = "=0.14.0", default-features = false, features = ["std", "frame"] }
|
||||
matchit = "0.9.2"
|
||||
md-5 = "0.11.0"
|
||||
mime_guess = "2.0.5"
|
||||
@@ -340,30 +332,36 @@ percent-encoding = "2.3.2"
|
||||
# CLI needs its own QR encoder. No default features: the image/render backends
|
||||
# pull in an image stack this only needs SVG and text output from.
|
||||
qrcode-rs = { version = "2.2.0", default-features = false, features = ["std", "svg"] }
|
||||
pin-project-lite = "0.2.18"
|
||||
pin-project-lite = "0.2.17"
|
||||
pretty_assertions = "1.4.1"
|
||||
rand = { version = "0.10.4" }
|
||||
rand = { version = "0.10.3" }
|
||||
ratelimit = "2.0.0"
|
||||
rayon = "1.12.0"
|
||||
rustfs-erasure-codec = { version = "9.1.0" }
|
||||
reed-solomon-simd = "3.1.0"
|
||||
regex = { version = "1.13.2" }
|
||||
regex = { version = "1.13.1" }
|
||||
rumqttc = { package = "rumqttc-next", version = "0.34.0" }
|
||||
redis = { version = "1.8.2" }
|
||||
redis = { version = "1.8.1" }
|
||||
rustify = { version = "0.7", default-features = false }
|
||||
rustix = { version = "1.1.6" }
|
||||
rust-embed = { version = "8.14.0" }
|
||||
rustc-hash = { version = "2.1.3" }
|
||||
s3s = { git = "https://github.com/s3s-project/s3s", rev = "5761ddfe4c509fcac87e3b99fd5bd9e176b442c0", features = ["minio"] }
|
||||
s3s-sigv4 = { git = "https://github.com/s3s-project/s3s", rev = "5761ddfe4c509fcac87e3b99fd5bd9e176b442c0" }
|
||||
# The same s3s pin under the name the legacy edge of the gateway migration uses
|
||||
# (crates/s3-types, feature `compat-s3s`). Keep `rev` identical to `s3s` above.
|
||||
# DELETE BY T4.2 (rustfs/backlog#2784).
|
||||
legacy-s3s = { package = "s3s", git = "https://github.com/s3s-project/s3s", rev = "5761ddfe4c509fcac87e3b99fd5bd9e176b442c0", features = ["minio"] }
|
||||
serial_test = "4.0.1"
|
||||
shadow-rs = { default-features = false, version = "2.0.0" }
|
||||
siphasher = "1.0.4"
|
||||
smallvec = { version = "1.16.6" }
|
||||
smallvec = { version = "1.16.5" }
|
||||
compact_str = "0.10.0"
|
||||
snap = "1.1.2"
|
||||
starshard = { version = "2.4.1" }
|
||||
strum = { version = "0.28.0" }
|
||||
sync_wrapper = "1.0.2"
|
||||
sysinfo = "0.40.4"
|
||||
sysinfo = "0.40.3"
|
||||
temp-env = "0.3.6"
|
||||
tempfile = "3.27.0"
|
||||
test-case = "3.4.1"
|
||||
@@ -375,23 +373,23 @@ tracing-error = "0.2.1"
|
||||
tracing-opentelemetry = { version = "0.34.0" }
|
||||
tracing-subscriber = { version = "0.3.23" }
|
||||
transform-stream = "0.3.1"
|
||||
url = "2.5.9"
|
||||
url = "2.5.8"
|
||||
urlencoding = "2.1.3"
|
||||
uuid = { version = "1.29.3" }
|
||||
uuid = { version = "1.29.2" }
|
||||
vaultrs = { version = "0.8.0" }
|
||||
tar = "0.4.46"
|
||||
walkdir = "2.5.1"
|
||||
walkdir = "2.5.0"
|
||||
winapi-util = "0.1.11"
|
||||
windows = { version = "0.62.2" }
|
||||
windows-sys = "0.61.2"
|
||||
xxhash-rust = { version = "0.8.21" }
|
||||
zip = "9.8.1"
|
||||
xxhash-rust = { version = "0.8.19" }
|
||||
zip = "9.5.1"
|
||||
zstd = "0.14.4"
|
||||
|
||||
# Observability and Metrics
|
||||
metrics = "0.24.6"
|
||||
metrics-util = "0.20"
|
||||
dial9 = { version = "0.5.9", default-features = false }
|
||||
dial9 = { version = "0.5.8", default-features = false }
|
||||
opentelemetry = { version = "0.33.1" }
|
||||
opentelemetry-appender-tracing = { version = "0.33.1" }
|
||||
opentelemetry-otlp = { version = "0.33.1" }
|
||||
@@ -402,12 +400,12 @@ opentelemetry-stdout = { version = "0.33.1" }
|
||||
pyroscope = { version = "2.1.5" }
|
||||
|
||||
# FTP and SFTP
|
||||
libunftp = { version = "0.25.1" }
|
||||
libunftp = { version = "0.25.0" }
|
||||
unftp-core = "0.1.1"
|
||||
suppaftp = { version = "13.0.0" }
|
||||
suppaftp = { version = "12.2.1" }
|
||||
rcgen = { version = "0.14.10", default-features = false, features = ["aws_lc_rs", "crypto", "pem"] }
|
||||
russh = { version = "0.65.4" }
|
||||
russh-sftp = "4.0.0"
|
||||
russh = { version = "0.65.1" }
|
||||
russh-sftp = "3.0.1"
|
||||
|
||||
# WebDAV
|
||||
dav-server = "0.12.0"
|
||||
@@ -415,15 +413,12 @@ dav-server = "0.12.0"
|
||||
# Performance Analysis and Memory Profiling
|
||||
rustfs-mimalloc = { version = "0.7.4" }
|
||||
# Preserve Unicode focus filters until rustfs/backlog#2302 is resolved.
|
||||
hotpath = { version = "0.32.1", default-features = false }
|
||||
hotpath = { version = "0.31.2", default-features = false }
|
||||
# Snapshot testing for output format regression detection
|
||||
insta = { version = "1.49" }
|
||||
|
||||
[workspace.metadata.cargo-shear]
|
||||
# The `#[path]` test modules under `rustfs/src/server/http/tests/` are linked by
|
||||
# rustc (including the `http.rs` + `http/` sibling-directory rule), but cargo-shear
|
||||
# resolves those nested `#[path]` attributes against the wrong base directory.
|
||||
ignored-paths = ["rustfs/src/server/http/tests/**/*.rs"]
|
||||
ignored = ["hotpath", "rustfs"]
|
||||
|
||||
[profile.dev]
|
||||
# Full debuginfo roughly doubles compile+link time and produces multi-GB
|
||||
@@ -458,6 +453,4 @@ strip = "none"
|
||||
|
||||
# Pin upstream fixes until compatible crates.io releases are available.
|
||||
[patch.crates-io]
|
||||
# Remove after Hyper releases HTTP/2 Expect support (hyperium/hyper#4217).
|
||||
hyper = { path = "vendor/hyper" }
|
||||
zstd = { path = "crates/zstd-compat" }
|
||||
|
||||
@@ -15,11 +15,12 @@ workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
hotpath = ["rustfs-io-core/hotpath"]
|
||||
hotpath-alloc = ["hotpath", "rustfs-io-core/hotpath-alloc"]
|
||||
hotpath-cpu = ["hotpath", "rustfs-io-core/hotpath-cpu"]
|
||||
hotpath = ["hotpath/hotpath", "hotpath/tokio", "rustfs-io-core/hotpath"]
|
||||
hotpath-alloc = ["hotpath", "hotpath/hotpath-alloc", "rustfs-io-core/hotpath-alloc"]
|
||||
hotpath-cpu = ["hotpath", "hotpath/hotpath-cpu", "rustfs-io-core/hotpath-cpu"]
|
||||
|
||||
[dependencies]
|
||||
hotpath.workspace = true
|
||||
# Internal crates
|
||||
rustfs-io-core = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
|
||||
@@ -129,12 +129,6 @@ when restoring `/rustfs/console` for a custom OEM build.
|
||||
- `RUSTFS_SCANNER_MAX_CONCURRENT_SET_SCANS` (canonical)
|
||||
- `RUSTFS_SCANNER_MAX_CONCURRENT_DISK_SCANS` (canonical)
|
||||
- `RUSTFS_SCANNER_WALKERS_PER_DISK` (canonical)
|
||||
- `RUSTFS_SCANNER_READ_ONLY_HANDOFF` (canonical, default `false`)
|
||||
|
||||
Read-only restart continuity:
|
||||
|
||||
- `RUSTFS_SCANNER_READ_ONLY_HANDOFF=true` enables reuse of unpublished scanner progress across verified read-only process restarts. Unset, false or invalid values disable both identity restoration and receipt creation. Existing receipts are still durably consumed before recovery starts, even when the feature is disabled.
|
||||
- Deploy receipt-aware readers to every possible writer before enabling this flag. Before rolling back to an older binary, disable it on every node, start each node with all its drives present, wait for readiness, and shut down cleanly. Do not start the older binary until every node completes this preparation. Direct rollback after enabling receipt writes is unsupported: older startup/recovery paths can write without durably invalidating the receipt. See [the receipt and rollback contract](../../docs/architecture/scanner-usage-publication.md#read-only-restart-continuity).
|
||||
|
||||
Scanner cycle budget controls:
|
||||
|
||||
@@ -308,8 +302,6 @@ Drive timeout profile preset:
|
||||
|
||||
RustFS production guidance remains direct-attached local POSIX filesystems. Network-mounted filesystems (for example `nfs`, `cifs`, `smb2`, and `fuse.*`) are treated as unsupported by this startup guard. On Windows, endpoints on network drives (UNC shares such as `\\server\share` and mapped drive letters) are treated the same way, even though Windows reports the server's filesystem (usually `NTFS`) for them.
|
||||
|
||||
A local POSIX filesystem bind-mounted into a gVisor sandbox with directfs is a supported storage path. gVisor presents that bind mount as `9p`/`V9FS`, so the host filesystem type is not visible; the startup guard recognizes mountinfo options `trans=fd` and `directfs` and does not treat the mount as unsupported. Genuine 9p, virtio, and NFS shares remain unsupported.
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the Apache License 2.0 - see the [LICENSE](../../LICENSE) file for details.
|
||||
|
||||
@@ -21,11 +21,6 @@ pub const APP_NAME: &str = "RustFS";
|
||||
/// Cargo package version for this workspace member.
|
||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
/// Opt in to scanner checkpoint continuity across verified read-only restarts.
|
||||
/// Defaults to false. Enable only after all possible writers support receipt
|
||||
/// consumption; disable and restart before rolling back to an older writer.
|
||||
pub const ENV_SCANNER_READ_ONLY_HANDOFF: &str = "RUSTFS_SCANNER_READ_ONLY_HANDOFF";
|
||||
|
||||
/// Default configuration logger level
|
||||
/// Default value: error
|
||||
/// Environment variable: RUSTFS_OBS_LOGGER_LEVEL
|
||||
@@ -255,24 +250,6 @@ pub const ENV_RUSTFS_KMS_ENFORCE_SSE_KEY_POLICY: &str = "RUSTFS_KMS_ENFORCE_SSE_
|
||||
/// working; the default flips to on in a later release.
|
||||
pub const DEFAULT_KMS_ENFORCE_SSE_KEY_POLICY: bool = false;
|
||||
|
||||
/// Write-side switch for opening every encrypted multipart part segment with
|
||||
/// an authenticated random segment-nonce frame (`0x03`).
|
||||
///
|
||||
/// Off by default for rolling-upgrade safety: nodes without `0x03` read support
|
||||
/// reject segment-nonce frames, and encrypted ciphertext travels verbatim
|
||||
/// through transition, decommission, heal, and SSE-C replication passthrough.
|
||||
/// Enable only after every node (and every RustFS warm or replication target
|
||||
/// receiving raw ciphertext) runs a release with segment-nonce read support.
|
||||
/// Reading `0x03` segments needs no switch; the default flips in a later
|
||||
/// release.
|
||||
pub const ENV_RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE: &str = "RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE";
|
||||
|
||||
/// Default write-side switch for multipart segment-nonce frames.
|
||||
///
|
||||
/// Default value: false
|
||||
/// Environment variable: RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE
|
||||
pub const DEFAULT_RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE: bool = false;
|
||||
|
||||
/// Environment variable for server KMS backend.
|
||||
pub const ENV_RUSTFS_KMS_BACKEND: &str = "RUSTFS_KMS_BACKEND";
|
||||
|
||||
@@ -444,7 +421,6 @@ mod tests {
|
||||
DEFAULT_ADDRESS,
|
||||
DEFAULT_CONSOLE_ADDRESS,
|
||||
ENV_RUSTFS_BROWSER_REDIRECT_URL,
|
||||
ENV_RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE,
|
||||
];
|
||||
|
||||
for constant in &string_constants {
|
||||
@@ -487,12 +463,4 @@ mod tests {
|
||||
assert_eq!(DEFAULT_ADDRESS, format!(":{DEFAULT_PORT}"));
|
||||
assert_eq!(DEFAULT_CONSOLE_ADDRESS, format!(":{DEFAULT_CONSOLE_PORT}"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multipart_segment_nonce_constants() {
|
||||
assert_eq!(ENV_RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE, "RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE");
|
||||
const {
|
||||
assert!(!DEFAULT_RUSTFS_ENCRYPTION_MULTIPART_SEGMENT_NONCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,23 +43,6 @@ pub const MAX_IAM_IMPORT_EXPANDED_SIZE: u64 = 100 * 1024 * 1024; // 100 MB
|
||||
/// 100MB allows importing metadata for ~10,000 buckets with reasonable configs.
|
||||
pub const MAX_BUCKET_METADATA_IMPORT_SIZE: usize = 100 * 1024 * 1024; // 100 MB
|
||||
|
||||
/// Maximum total size the members of a bucket metadata import ZIP may expand to (100 MB).
|
||||
/// Used for: bounding total decompression of `ImportBucketMetadata` archive members.
|
||||
/// Rationale: `MAX_BUCKET_METADATA_IMPORT_SIZE` caps the *compressed* upload only, and
|
||||
/// the archive may use any compression method the `zip` crate supports (deflate, bzip2, zstd, ...),
|
||||
/// so without a separate budget a few hundred bytes can expand to gigabytes. Bucket
|
||||
/// configs are small XML/JSON documents: 100 MB of them still covers the ~10,000
|
||||
/// buckets the compressed cap is sized for while keeping worst-case allocation bounded.
|
||||
pub const MAX_BUCKET_METADATA_IMPORT_EXPANDED_SIZE: u64 = 100 * 1024 * 1024; // 100 MB
|
||||
|
||||
/// Maximum expanded size of a single member inside a bucket metadata import ZIP (1 MB).
|
||||
/// Used for: bounding individual configuration payloads in `ImportBucketMetadata`.
|
||||
/// Rationale: Individual bucket configuration files (policy, lifecycle, replication, etc.)
|
||||
/// are small XML/JSON documents well under 1 MB (matching `MAX_ADMIN_REQUEST_BODY_SIZE`).
|
||||
/// Capping each member prevents repeated oversized config payloads from bloating
|
||||
/// persisted bucket metadata and startup memory across restarts.
|
||||
pub const MAX_BUCKET_METADATA_IMPORT_MEMBER_SIZE: u64 = 1024 * 1024; // 1 MB
|
||||
|
||||
/// Maximum size for healing operation requests (1 MB)
|
||||
/// Used for: Healing parameters and configuration
|
||||
/// Rationale: Healing requests contain bucket/object paths and options. Should be small.
|
||||
@@ -82,7 +65,7 @@ pub const MAX_HEAL_REQUEST_SIZE: usize = 1024 * 1024; // 1 MB
|
||||
pub const MAX_S3_CLIENT_RESPONSE_SIZE: usize = 10 * 1024 * 1024; // 10 MB
|
||||
|
||||
/// Maximum body size accepted by a single `PutObject` or `UploadPart` request (5 GiB).
|
||||
/// Enforced on the upload body and at request-header admission.
|
||||
/// Used for: the s3s streaming-body limit and the request-header admission check.
|
||||
/// Rationale: matches the AWS S3 single-PUT / single-part ceiling. Larger objects
|
||||
/// must use multipart upload. The header check rejects an oversize
|
||||
/// `Content-Length` before any body byte is read so the client gets
|
||||
|
||||
@@ -32,9 +32,6 @@ pub const DEFAULT_HEAL_BITROT_CYCLE_SECS: u64 = 30 * 24 * 60 * 60;
|
||||
/// - Note: Enabling auto-heal can improve system resilience by automatically addressing issues, but may increase resource usage; evaluate based on your operational requirements.
|
||||
pub const ENV_HEAL_AUTO_HEAL_ENABLE: &str = "RUSTFS_HEAL_AUTO_HEAL_ENABLE";
|
||||
|
||||
/// Colon-separated Linux mount roots for automatic replacement of data directories below a mount point.
|
||||
pub const ENV_HEAL_REPLACEMENT_MOUNT_ROOTS: &str = "RUSTFS_HEAL_REPLACEMENT_MOUNT_ROOTS";
|
||||
|
||||
/// Environment variable name that specifies the heal queue size.
|
||||
///
|
||||
/// - Purpose: Set the maximum number of heal requests that can be queued.
|
||||
|
||||
@@ -349,8 +349,10 @@ pub const DEFAULT_INTERNODE_DATA_TRANSPORT: &str = "tcp-http";
|
||||
/// Legacy alias for "tcp-http". Both values select the TCP/HTTP transport backend.
|
||||
pub const INTERNODE_DATA_TRANSPORT_TCP: &str = "tcp";
|
||||
|
||||
/// Shard reads and writes use NIXL/UCX and require an active NIXL agent on both peers.
|
||||
/// Format metadata, directory walks and scanner requests use the control transport.
|
||||
/// Internode reads whose data moves over NIXL/UCX (InfiniBand rails or RoCE by
|
||||
/// LID/GID, no IP needed); requests, writes and walks stay on TCP/HTTP. Requires
|
||||
/// a binary built with the `nixl` feature and `RUSTFS_NIXL_ENABLE`; until the
|
||||
/// NIXL agent is up, and for any read it cannot serve, it uses TCP/HTTP.
|
||||
pub const INTERNODE_DATA_TRANSPORT_NIXL: &str = "nixl";
|
||||
|
||||
/// Known internode transport backend names accepted by the config parser.
|
||||
|
||||
@@ -152,33 +152,6 @@ pub const DEFAULT_SHARD_INTEGRITY_WRITE: bool = false;
|
||||
pub const ENV_SHARD_INTEGRITY_FLEET_CONFIRMED: &str = "RUSTFS_SHARD_INTEGRITY_FLEET_CONFIRMED";
|
||||
pub const DEFAULT_SHARD_INTEGRITY_FLEET_CONFIRMED: bool = false;
|
||||
|
||||
/// Request parsing switch for the per-object erasure-code block-size hint.
|
||||
/// The default keeps the feature inert during rolling upgrades.
|
||||
pub const ENV_EC_BLOCK_SIZE_HINT_ENABLE: &str = "RUSTFS_EC_BLOCK_SIZE_HINT_ENABLE";
|
||||
pub const DEFAULT_EC_BLOCK_SIZE_HINT_ENABLE: bool = false;
|
||||
|
||||
/// Operator confirmation that every writer and reader in the fleet understands
|
||||
/// the persisted erasure block-size geometry.
|
||||
pub const ENV_EC_BLOCK_SIZE_HINT_FLEET_CONFIRMED: &str = "RUSTFS_EC_BLOCK_SIZE_HINT_FLEET_CONFIRMED";
|
||||
pub const DEFAULT_EC_BLOCK_SIZE_HINT_FLEET_CONFIRMED: bool = false;
|
||||
|
||||
/// Write new EC shards with a bounded bitrot frame size so Range GETs do not
|
||||
/// inherit the full persisted layout block as their physical read quantum.
|
||||
/// The marker is only emitted after the fleet confirmation gate is enabled;
|
||||
/// readers without this feature continue to consume legacy objects unchanged.
|
||||
pub const ENV_EC_READ_QUANTUM_ENABLE: &str = "RUSTFS_EC_READ_QUANTUM_ENABLE";
|
||||
pub const DEFAULT_EC_READ_QUANTUM_ENABLE: bool = false;
|
||||
|
||||
/// Operator confirmation that every reader and writer understands the
|
||||
/// persisted EC read-quantum marker and its per-frame bitrot layout.
|
||||
pub const ENV_EC_READ_QUANTUM_FLEET_CONFIRMED: &str = "RUSTFS_EC_READ_QUANTUM_FLEET_CONFIRMED";
|
||||
pub const DEFAULT_EC_READ_QUANTUM_FLEET_CONFIRMED: bool = false;
|
||||
|
||||
const _: () = assert!(!DEFAULT_EC_BLOCK_SIZE_HINT_ENABLE);
|
||||
const _: () = assert!(!DEFAULT_EC_BLOCK_SIZE_HINT_FLEET_CONFIRMED);
|
||||
const _: () = assert!(!DEFAULT_EC_READ_QUANTUM_ENABLE);
|
||||
const _: () = assert!(!DEFAULT_EC_READ_QUANTUM_FLEET_CONFIRMED);
|
||||
|
||||
const _: () = assert!(!DEFAULT_SHARD_INTEGRITY_WRITE);
|
||||
const _: () = assert!(!DEFAULT_SHARD_INTEGRITY_FLEET_CONFIRMED);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ pub const ENV_RUNTIME_DIAL9_S3_PREFIX: &str = "RUSTFS_RUNTIME_DIAL9_S3_PREFIX";
|
||||
pub const DEFAULT_WORKER_THREADS: usize = 16;
|
||||
pub const DEFAULT_MAX_BLOCKING_THREADS: usize = 1024;
|
||||
pub const DEFAULT_THREAD_PRINT_ENABLED: bool = false;
|
||||
pub const DEFAULT_THREAD_STACK_SIZE: usize = 2 * MI_B; // 2 MiB
|
||||
pub const DEFAULT_THREAD_STACK_SIZE: usize = MI_B; // 1 MiB
|
||||
pub const DEFAULT_THREAD_KEEP_ALIVE: u64 = 60; // seconds
|
||||
pub const DEFAULT_GLOBAL_QUEUE_INTERVAL: u32 = 31;
|
||||
pub const DEFAULT_THREAD_NAME: &str = "rustfs-worker";
|
||||
|
||||
@@ -36,7 +36,7 @@ jsonwebtoken = { workspace = true, features = ["aws_lc_rs"] }
|
||||
base64-simd = { workspace = true }
|
||||
pbkdf2 = { workspace = true, optional = true }
|
||||
rand = { workspace = true, features = ["serde"] }
|
||||
rsa = { workspace = true }
|
||||
rsa = { workspace = true, features = ["sha2"] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
sha2 = { workspace = true, optional = true }
|
||||
thiserror.workspace = true
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
// limitations under the License.
|
||||
|
||||
use rsa::{
|
||||
Pkcs1v15Encrypt, PrivateKey, PublicKey,
|
||||
Pkcs1v15Encrypt, RsaPrivateKey, RsaPublicKey,
|
||||
pkcs8::{DecodePrivateKey, DecodePublicKey},
|
||||
pss::{Signature, SigningKey, VerifyingKey},
|
||||
pss::{BlindedSigningKey, Signature, VerifyingKey},
|
||||
sha2::Sha256,
|
||||
signature::{RandomizedSigner, Verifier},
|
||||
traits::PublicKeyParts,
|
||||
@@ -37,7 +37,7 @@ pub struct Token {
|
||||
pub fn gencode(token: &Token, key: &str) -> Result<String> {
|
||||
let data = serde_json::to_vec(token)?;
|
||||
let mut rng = rand::rng();
|
||||
let public_key = PublicKey::from_public_key_pem(key).map_err(Error::other)?;
|
||||
let public_key = RsaPublicKey::from_public_key_pem(key).map_err(Error::other)?;
|
||||
let encrypted_data = public_key.encrypt(&mut rng, Pkcs1v15Encrypt, &data).map_err(Error::other)?;
|
||||
Ok(base64_simd::URL_SAFE_NO_PAD.encode_to_string(&encrypted_data))
|
||||
}
|
||||
@@ -51,7 +51,7 @@ pub fn parse(token: &str, key: &str) -> Result<Token> {
|
||||
let encrypted_data = base64_simd::URL_SAFE_NO_PAD
|
||||
.decode_to_vec(token.as_bytes())
|
||||
.map_err(Error::other)?;
|
||||
let private_key = PrivateKey::from_pkcs8_pem(key).map_err(Error::other)?;
|
||||
let private_key = RsaPrivateKey::from_pkcs8_pem(key).map_err(Error::other)?;
|
||||
let decrypted_data = private_key.decrypt(Pkcs1v15Encrypt, &encrypted_data).map_err(Error::other)?;
|
||||
serde_json::from_slice(&decrypted_data).map_err(Error::other)
|
||||
}
|
||||
@@ -63,8 +63,8 @@ pub fn parse(token: &str, key: &str) -> Result<Token> {
|
||||
pub fn sign_license_token(token: &Token, private_key_pem: &str) -> Result<String> {
|
||||
let payload = serde_json::to_vec(token)?;
|
||||
let mut rng = rand::rng();
|
||||
let private_key = PrivateKey::from_pkcs8_pem(private_key_pem).map_err(Error::other)?;
|
||||
let signing_key = SigningKey::<Sha256>::new(private_key);
|
||||
let private_key = RsaPrivateKey::from_pkcs8_pem(private_key_pem).map_err(Error::other)?;
|
||||
let signing_key = BlindedSigningKey::<Sha256>::new(private_key);
|
||||
let signature: Signature = signing_key.try_sign_with_rng(&mut rng, &payload).map_err(Error::other)?;
|
||||
let signature: Box<[u8]> = signature.into();
|
||||
|
||||
@@ -80,7 +80,7 @@ pub fn parse_signed_license_token(token: &str, public_key_pem: &str) -> Result<T
|
||||
let signed_payload = base64_simd::URL_SAFE_NO_PAD
|
||||
.decode_to_vec(token.as_bytes())
|
||||
.map_err(Error::other)?;
|
||||
let public_key = PublicKey::from_public_key_pem(public_key_pem).map_err(Error::other)?;
|
||||
let public_key = RsaPublicKey::from_public_key_pem(public_key_pem).map_err(Error::other)?;
|
||||
let signature_len = public_key.size();
|
||||
|
||||
if signed_payload.len() <= signature_len {
|
||||
@@ -103,7 +103,7 @@ pub fn parse_license_with_public_key(license: &str, public_key: &str) -> Result<
|
||||
mod tests {
|
||||
use super::*;
|
||||
use rsa::{
|
||||
PrivateKey,
|
||||
RsaPrivateKey,
|
||||
pkcs8::{EncodePrivateKey, EncodePublicKey, LineEnding},
|
||||
};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
@@ -112,8 +112,8 @@ mod tests {
|
||||
fn test_sign_license_token_and_parse_signed_license_token() {
|
||||
let mut rng = rand::rng();
|
||||
let bits = 2048;
|
||||
let private_key = PrivateKey::new(&mut rng, bits).expect("Failed to generate private key");
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let private_key = RsaPrivateKey::new(&mut rng, bits).expect("Failed to generate private key");
|
||||
let public_key = RsaPublicKey::from(&private_key);
|
||||
|
||||
let private_key_pem = private_key
|
||||
.to_pkcs8_pem(LineEnding::LF)
|
||||
@@ -144,8 +144,8 @@ mod tests {
|
||||
fn test_legacy_gencode_and_parse_roundtrip() {
|
||||
let mut rng = rand::rng();
|
||||
let bits = 2048;
|
||||
let private_key = PrivateKey::new(&mut rng, bits).expect("Failed to generate private key");
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let private_key = RsaPrivateKey::new(&mut rng, bits).expect("Failed to generate private key");
|
||||
let public_key = RsaPublicKey::from(&private_key);
|
||||
|
||||
let private_key_pem = private_key
|
||||
.to_pkcs8_pem(LineEnding::LF)
|
||||
@@ -173,8 +173,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_parse_signed_license_token_rejects_tampered_payload() {
|
||||
let mut rng = rand::rng();
|
||||
let private_key = PrivateKey::new(&mut rng, 2048).expect("Failed to generate private key");
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let private_key = RsaPrivateKey::new(&mut rng, 2048).expect("Failed to generate private key");
|
||||
let public_key = RsaPublicKey::from(&private_key);
|
||||
let private_key_pem = private_key
|
||||
.to_pkcs8_pem(LineEnding::LF)
|
||||
.expect("failed to encode private key pem");
|
||||
@@ -206,8 +206,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_parse_signed_license_token_rejects_invalid_token() {
|
||||
let mut rng = rand::rng();
|
||||
let private_key = PrivateKey::new(&mut rng, 2048).expect("Failed to generate private key");
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let private_key = RsaPrivateKey::new(&mut rng, 2048).expect("Failed to generate private key");
|
||||
let public_key = RsaPublicKey::from(&private_key);
|
||||
let public_key_pem = public_key
|
||||
.to_public_key_pem(LineEnding::LF)
|
||||
.expect("failed to encode public key pem");
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
[package]
|
||||
name = "rustfs-cuobject-sys"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
version.workspace = true
|
||||
description = "Native bindings to the NVIDIA cuObject server SDK"
|
||||
links = "cuobjserver"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
cxx = { workspace = true, optional = true }
|
||||
libc = { workspace = true, optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
cxx-build = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
server = ["dep:cxx", "dep:cxx-build", "dep:libc"]
|
||||
@@ -1,41 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
fn main() {
|
||||
#[cfg(feature = "server")]
|
||||
build_server();
|
||||
}
|
||||
|
||||
#[cfg(feature = "server")]
|
||||
fn build_server() {
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
println!("cargo:rerun-if-env-changed=CUOBJSERVER_ROOT");
|
||||
for file in ["src/sdk.rs", "native/server.h", "native/server.cc"] {
|
||||
println!("cargo:rerun-if-changed={file}");
|
||||
}
|
||||
let mut build = cxx_build::bridge("src/sdk.rs");
|
||||
if let Some(root) = env::var_os("CUOBJSERVER_ROOT").map(PathBuf::from) {
|
||||
build.include(root.join("include"));
|
||||
for subdir in ["lib", "lib64"] {
|
||||
println!("cargo:rustc-link-search=native={}", root.join(subdir).display());
|
||||
}
|
||||
}
|
||||
build
|
||||
.include(".")
|
||||
.file("native/server.cc")
|
||||
.std("c++17")
|
||||
.compile("rustfs_cuobject_server");
|
||||
println!("cargo:rustc-link-lib=cuobjserver");
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
#include "rustfs-cuobject-sys/src/sdk.rs.h"
|
||||
#include <cuobjserver.h>
|
||||
#include <array>
|
||||
#include <cerrno>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
#include <system_error>
|
||||
#include <sys/mman.h>
|
||||
|
||||
namespace rustfs::cuobject {
|
||||
|
||||
class Server {
|
||||
public:
|
||||
Server(std::string address, std::uint16_t port, int channels, std::uint32_t depth)
|
||||
: address_(std::move(address)) {
|
||||
cuObjRDMATunable options;
|
||||
if (channels > 0) options.setNumDcis(channels);
|
||||
if (depth > 0) options.setCqDepth(depth);
|
||||
sdk = std::make_unique<cuObjServer>(address_.c_str(), port, CUOBJ_PROTO_RDMA_DC_V1, options);
|
||||
}
|
||||
// The SDK may retain the address string through server teardown.
|
||||
const std::string address_;
|
||||
std::unique_ptr<cuObjServer> sdk;
|
||||
};
|
||||
|
||||
std::uint32_t header_version() noexcept {
|
||||
return CUOBJ_SERVER_MAJOR_VERSION * 1000 + CUOBJ_SERVER_MINOR_VERSION;
|
||||
}
|
||||
|
||||
std::shared_ptr<Server> open_server(rust::Str addr, std::uint16_t port, int channels, std::uint32_t depth) {
|
||||
return std::make_shared<Server>(std::string(addr), port, channels, depth);
|
||||
}
|
||||
|
||||
class Buffer {
|
||||
public:
|
||||
std::shared_ptr<Server> owner;
|
||||
std::shared_ptr<Buffer> base;
|
||||
rdma_buffer* handle = nullptr;
|
||||
void* mapping = MAP_FAILED;
|
||||
std::size_t length = 0;
|
||||
|
||||
static void destroy(Buffer* buffer) noexcept {
|
||||
try {
|
||||
if (buffer->handle) {
|
||||
if (buffer->base) buffer->owner->sdk->putRDMABufferFromSgList(buffer->handle);
|
||||
else buffer->owner->sdk->deRegisterBuffer(buffer->handle);
|
||||
}
|
||||
} catch (...) {
|
||||
// The SDK may still reference the mapping and its owning server.
|
||||
return;
|
||||
}
|
||||
if (buffer->mapping != MAP_FAILED) munmap(buffer->mapping, buffer->length);
|
||||
delete buffer;
|
||||
}
|
||||
};
|
||||
|
||||
std::shared_ptr<Buffer> register_buffer(std::shared_ptr<Server> server, std::size_t length) {
|
||||
if (!server || !length) throw std::invalid_argument("invalid host registration");
|
||||
auto buffer = std::shared_ptr<Buffer>(new Buffer, Buffer::destroy);
|
||||
buffer->owner = std::move(server);
|
||||
buffer->length = length;
|
||||
buffer->mapping = mmap(nullptr, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (buffer->mapping == MAP_FAILED) throw std::system_error(errno, std::generic_category(), "mmap");
|
||||
buffer->handle = buffer->owner->sdk->registerBuffer(buffer->mapping, length);
|
||||
if (!buffer->handle) throw std::runtime_error("NVIDIA memory registration failed");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
std::shared_ptr<Buffer> scatter_list(std::shared_ptr<Buffer> base, rust::Slice<const Range> ranges) {
|
||||
if (!base || base->base || ranges.empty() || ranges.size() > 10) throw std::invalid_argument("invalid scatter list");
|
||||
auto list = std::shared_ptr<Buffer>(new Buffer, Buffer::destroy);
|
||||
list->owner = base->owner;
|
||||
list->base = std::move(base);
|
||||
std::vector<cuObjScatterGatherEntryWithOffset_t> entries;
|
||||
entries.reserve(ranges.size());
|
||||
for (auto range : ranges) {
|
||||
if (!range.size || range.offset > list->base->length || range.size > list->base->length - range.offset ||
|
||||
range.offset > std::numeric_limits<loff_t>::max() || range.size > SIZE_MAX - list->length)
|
||||
throw std::invalid_argument("invalid scatter range");
|
||||
entries.push_back({static_cast<loff_t>(range.offset), range.size});
|
||||
list->length += range.size;
|
||||
}
|
||||
list->handle = list->owner->sdk->getRDMABufferFromSgList(list->base->handle, std::move(entries));
|
||||
if (!list->handle) throw std::runtime_error("NVIDIA scatter list registration failed");
|
||||
return list;
|
||||
}
|
||||
|
||||
std::uint8_t* data(const Buffer& buffer) noexcept { return static_cast<std::uint8_t*>(buffer.mapping); }
|
||||
std::size_t size(const Buffer& buffer) noexcept { return buffer.length; }
|
||||
|
||||
std::uint16_t lease_channel(const Server& server) { return server.sdk->allocateChannelId(); }
|
||||
void release_channel(const Server& server, std::uint16_t channel) noexcept {
|
||||
try { server.sdk->freeChannelId(channel); } catch (...) { /* SDK owns the channel. */ }
|
||||
}
|
||||
int completion_fd(const Server& server, std::uint16_t channel) noexcept {
|
||||
try { return server.sdk->getCompletionFd(channel); } catch (...) { return -EIO; }
|
||||
}
|
||||
|
||||
int drain(const Server& server, int fd, rust::Slice<Completion> out) noexcept {
|
||||
std::array<cuObjAsyncEvent_t, 8> events{};
|
||||
if (out.empty() || out.size() > events.size()) return -EINVAL;
|
||||
try {
|
||||
const int count = server.sdk->processCompletions(events.data(), static_cast<int>(out.size()), fd);
|
||||
if (count > static_cast<int>(out.size())) return -EIO;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
out[i] = {reinterpret_cast<std::uintptr_t>(events[i].async_handle), events[i].status};
|
||||
}
|
||||
return count;
|
||||
} catch (...) { return -EIO; }
|
||||
}
|
||||
|
||||
Outcome transfer(const Server& server, const Buffer& buffer, const Operation& op) noexcept {
|
||||
if (buffer.owner.get() != &server || !op.length || op.offset > buffer.length ||
|
||||
op.length > buffer.length - op.offset || (buffer.base && (op.offset || op.length != buffer.length)))
|
||||
return {-EINVAL, 0, false};
|
||||
ibv_wc_status verbs = IBV_WC_SUCCESS;
|
||||
bool submitted_to_sdk = false;
|
||||
try {
|
||||
const std::string key(op.key), token(op.token);
|
||||
void* handle = reinterpret_cast<void*>(op.handle);
|
||||
auto& sdk = *server.sdk;
|
||||
submitted_to_sdk = true;
|
||||
const ssize_t moved = op.put
|
||||
? sdk.handlePutObject(key, buffer.handle, op.address, op.length, token, op.channel, op.offset, &verbs, handle)
|
||||
: sdk.handleGetObject(key, buffer.handle, op.address, op.length, token, op.channel, op.offset, &verbs, handle);
|
||||
return {moved, static_cast<int>(verbs), false};
|
||||
} catch (...) { return {-EIO, static_cast<int>(verbs), submitted_to_sdk}; }
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
#pragma once
|
||||
#include "rust/cxx.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace rustfs::cuobject {
|
||||
class Server;
|
||||
class Buffer;
|
||||
struct Range;
|
||||
struct Completion;
|
||||
struct Operation;
|
||||
struct Outcome;
|
||||
|
||||
std::uint32_t header_version() noexcept;
|
||||
std::shared_ptr<Server> open_server(rust::Str address, std::uint16_t port, int channels, std::uint32_t depth);
|
||||
std::shared_ptr<Buffer> register_buffer(std::shared_ptr<Server> server, std::size_t length);
|
||||
std::shared_ptr<Buffer> scatter_list(std::shared_ptr<Buffer> base, rust::Slice<const Range> ranges);
|
||||
std::uint8_t* data(const Buffer& buffer) noexcept;
|
||||
std::size_t size(const Buffer& buffer) noexcept;
|
||||
std::uint16_t lease_channel(const Server& server);
|
||||
void release_channel(const Server& server, std::uint16_t channel) noexcept;
|
||||
int completion_fd(const Server& server, std::uint16_t channel) noexcept;
|
||||
int drain(const Server& server, int fd, rust::Slice<Completion> events) noexcept;
|
||||
Outcome transfer(const Server& server, const Buffer& buffer, const Operation& op) noexcept;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
//! Native bindings and SDK handle ownership for the NVIDIA cuObject server.
|
||||
#![cfg(feature = "server")]
|
||||
|
||||
pub use cxx::Exception;
|
||||
// SAFETY: this module declares the SDK ABI and the ownership of native handles.
|
||||
#[allow(unsafe_code)]
|
||||
mod sdk;
|
||||
pub use sdk::*;
|
||||
@@ -1,149 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
//! Private ABI for the NVIDIA server SDK.
|
||||
|
||||
use cxx::SharedPtr;
|
||||
use std::io;
|
||||
use std::os::fd::{AsRawFd, RawFd};
|
||||
|
||||
#[cxx::bridge(namespace = "rustfs::cuobject")]
|
||||
mod ffi {
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct Range {
|
||||
offset: usize,
|
||||
size: usize,
|
||||
}
|
||||
#[derive(Clone, Copy, Default)]
|
||||
struct Completion {
|
||||
handle: usize,
|
||||
status: isize,
|
||||
}
|
||||
struct Operation<'a> {
|
||||
key: &'a str,
|
||||
token: &'a str,
|
||||
address: u64,
|
||||
offset: usize,
|
||||
length: usize,
|
||||
channel: u16,
|
||||
handle: usize,
|
||||
put: bool,
|
||||
}
|
||||
struct Outcome {
|
||||
count: isize,
|
||||
verbs: i32,
|
||||
uncertain: bool,
|
||||
}
|
||||
|
||||
// SAFETY: native registrations own their server and mapping. Scatter views
|
||||
// also own their base. The caller keeps DMA ranges exclusive until completion.
|
||||
unsafe extern "C++" {
|
||||
include!("native/server.h");
|
||||
type Server;
|
||||
type Buffer;
|
||||
fn header_version() -> u32;
|
||||
fn open_server(address: &str, port: u16, channels: i32, depth: u32) -> Result<SharedPtr<Server>>;
|
||||
fn register_buffer(server: SharedPtr<Server>, length: usize) -> Result<SharedPtr<Buffer>>;
|
||||
fn scatter_list(base: SharedPtr<Buffer>, ranges: &[Range]) -> Result<SharedPtr<Buffer>>;
|
||||
fn size(buffer: &Buffer) -> usize;
|
||||
fn data(buffer: &Buffer) -> *mut u8;
|
||||
fn lease_channel(server: &Server) -> Result<u16>;
|
||||
fn release_channel(server: &Server, channel: u16);
|
||||
fn completion_fd(server: &Server, channel: u16) -> i32;
|
||||
fn drain(server: &Server, fd: i32, events: &mut [Completion]) -> i32;
|
||||
unsafe fn transfer(server: &Server, buffer: &Buffer, op: &Operation) -> Outcome;
|
||||
}
|
||||
}
|
||||
|
||||
// SAFETY: the SDK supports concurrent transfers on separately leased channels.
|
||||
// Server and registration metadata stay immutable after construction. Sharing a
|
||||
// handle gives no safe access to the host bytes.
|
||||
unsafe impl Send for ffi::Server {}
|
||||
unsafe impl Sync for ffi::Server {}
|
||||
unsafe impl Send for ffi::Buffer {}
|
||||
unsafe impl Sync for ffi::Buffer {}
|
||||
|
||||
pub use ffi::{Completion, Operation, Outcome, Range, data, header_version, open_server, register_buffer, scatter_list, size};
|
||||
|
||||
pub type ServerHandle = SharedPtr<ffi::Server>;
|
||||
pub type BufferHandle = SharedPtr<ffi::Buffer>;
|
||||
|
||||
pub fn errno(status: isize) -> io::Error {
|
||||
match status.checked_neg().and_then(|code| i32::try_from(code).ok()) {
|
||||
Some(code) => io::Error::from_raw_os_error(code),
|
||||
None => io::Error::other("invalid NVIDIA error status"),
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Channel {
|
||||
server: SharedPtr<ffi::Server>,
|
||||
id: u16,
|
||||
}
|
||||
|
||||
impl Channel {
|
||||
pub fn lease(server: &SharedPtr<ffi::Server>) -> io::Result<Self> {
|
||||
let id = ffi::lease_channel(server).map_err(io::Error::other)?;
|
||||
if id == u16::MAX {
|
||||
return Err(io::Error::from_raw_os_error(libc::EBUSY));
|
||||
}
|
||||
Ok(Self {
|
||||
server: server.clone(),
|
||||
id,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn fd(&self) -> Option<CompletionFd> {
|
||||
let fd = ffi::completion_fd(&self.server, self.id);
|
||||
(fd >= 0).then(|| CompletionFd {
|
||||
fd,
|
||||
server: self.server.clone(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Submits a transfer to the leased channel.
|
||||
///
|
||||
/// # Safety
|
||||
/// The caller must exclusively own the local range, keep the remote token valid,
|
||||
/// and retain the channel and registrations until the SDK confirms completion.
|
||||
/// An unknown submission or undelivered completion must preserve those owners.
|
||||
pub unsafe fn submit(&mut self, buffer: &ffi::Buffer, mut op: ffi::Operation<'_>) -> ffi::Outcome {
|
||||
op.channel = self.id;
|
||||
// SAFETY: the caller holds the range and the exclusive channel lease.
|
||||
unsafe { ffi::transfer(&self.server, buffer, &op) }
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Channel {
|
||||
fn drop(&mut self) {
|
||||
ffi::release_channel(&self.server, self.id);
|
||||
}
|
||||
}
|
||||
|
||||
pub struct CompletionFd {
|
||||
fd: RawFd,
|
||||
server: SharedPtr<ffi::Server>,
|
||||
}
|
||||
|
||||
impl AsRawFd for CompletionFd {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
self.fd
|
||||
}
|
||||
}
|
||||
|
||||
impl CompletionFd {
|
||||
pub fn drain(&self, events: &mut [ffi::Completion]) -> io::Result<usize> {
|
||||
let count = ffi::drain(&self.server, self.fd, events);
|
||||
usize::try_from(count).map_err(|_| errno(count as isize))
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,11 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
bytes = { workspace = true, optional = true }
|
||||
rustfs-cuobject-sys = { workspace = true, features = ["server"], optional = true }
|
||||
cuobject = { workspace = true, default-features = false, optional = true }
|
||||
parking_lot = { workspace = true, optional = true }
|
||||
thiserror = { workspace = true, optional = true }
|
||||
tokio = { workspace = true, features = ["net", "rt-multi-thread", "sync", "time"], optional = true }
|
||||
|
||||
[features]
|
||||
# Compiles the cuObject server bindings (needs the NVIDIA cuObject SDK).
|
||||
server = ["dep:bytes", "dep:rustfs-cuobject-sys", "dep:parking_lot", "dep:thiserror", "dep:tokio"]
|
||||
server = ["dep:bytes", "dep:cuobject", "cuobject/server", "dep:parking_lot", "dep:thiserror", "dep:tokio"]
|
||||
|
||||
+224
-650
File diff suppressed because it is too large
Load Diff
@@ -66,12 +66,6 @@ pub const LEGACY_DATA_USAGE_OBJECT_NAME: &str = ".usage.json";
|
||||
/// stale tier names from growing persisted per-tier maps without bound.
|
||||
pub const UNKNOWN_TIER: &str = "UNKNOWN_TIER";
|
||||
|
||||
/// Whether a remote tier name can be represented in scanner accounting.
|
||||
/// Local storage classes are checked separately by the configuration owner.
|
||||
pub fn is_scannable_tier_name(name: &str) -> bool {
|
||||
!name.is_empty() && name.len() <= 256 && !name.bytes().any(|byte| byte.is_ascii_control()) && name != UNKNOWN_TIER
|
||||
}
|
||||
|
||||
/// Returns true when `existing_last_update` is ahead of `now` by more than
|
||||
/// [`USAGE_LAST_UPDATE_FUTURE_TOLERANCE`], i.e. the persisted timestamp cannot be
|
||||
/// trusted for staleness comparisons and a fresh snapshot save must be allowed.
|
||||
@@ -1235,66 +1229,23 @@ impl Serialize for DataUsageEntry {
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
self.serialize_fields(serializer, &self.children, &self.replication_stats, &self.all_tier_stats)
|
||||
}
|
||||
}
|
||||
|
||||
struct OrderedUsageEntry<'a>(&'a DataUsageEntry);
|
||||
|
||||
impl Serialize for OrderedUsageEntry<'_> {
|
||||
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
let mut children: Vec<_> = self.0.children.iter().collect();
|
||||
children.sort_unstable();
|
||||
// MessagePack decoders accept struct fields as positional sequences.
|
||||
// Include the nested target and tier maps in stable order as well.
|
||||
let replication = self.0.replication_stats.as_ref().map(|stats| {
|
||||
let ReplicationAllStats {
|
||||
targets,
|
||||
replica_size,
|
||||
replica_count,
|
||||
} = stats;
|
||||
let targets: std::collections::BTreeMap<_, _> = targets.iter().collect();
|
||||
(targets, replica_size, replica_count)
|
||||
});
|
||||
let tiers = self.0.all_tier_stats.as_ref().map(|stats| {
|
||||
let AllTierStats { tiers } = stats;
|
||||
let tiers: std::collections::BTreeMap<_, _> = tiers.iter().collect();
|
||||
(tiers,)
|
||||
});
|
||||
self.0.serialize_fields(serializer, &children, &replication, &tiers)
|
||||
}
|
||||
}
|
||||
|
||||
impl DataUsageEntry {
|
||||
/// Stable MessagePack encoding for independently reusable scanner checkpoint pages.
|
||||
pub fn ordered_encoding(&self) -> impl Serialize + '_ {
|
||||
OrderedUsageEntry(self)
|
||||
}
|
||||
|
||||
fn serialize_fields<S: serde::Serializer, C: Serialize, R: Serialize, T: Serialize>(
|
||||
&self,
|
||||
serializer: S,
|
||||
children: &C,
|
||||
replication: &R,
|
||||
tiers: &T,
|
||||
) -> Result<S::Ok, S::Error> {
|
||||
// Keep entries map-encoded so older readers can ignore fields appended
|
||||
// by newer scanner versions during rolling upgrades. The derived
|
||||
// (array) encoding made any appended field a decode error for them.
|
||||
let mut state = serializer.serialize_map(Some(
|
||||
11 + usize::from(self.unknown_tier_stats.is_some()) + usize::from(self.tier_accounting_proof.is_some()),
|
||||
))?;
|
||||
state.serialize_entry("children", children)?;
|
||||
state.serialize_entry("children", &self.children)?;
|
||||
state.serialize_entry("size", &self.size)?;
|
||||
state.serialize_entry("objects", &self.objects)?;
|
||||
state.serialize_entry("versions", &self.versions)?;
|
||||
state.serialize_entry("delete_markers", &self.delete_markers)?;
|
||||
state.serialize_entry("obj_sizes", &self.obj_sizes)?;
|
||||
state.serialize_entry("obj_versions", &self.obj_versions)?;
|
||||
state.serialize_entry("replication_stats", replication)?;
|
||||
state.serialize_entry("replication_stats", &self.replication_stats)?;
|
||||
state.serialize_entry("compacted", &self.compacted)?;
|
||||
state.serialize_entry("failed_objects", &self.failed_objects)?;
|
||||
state.serialize_entry("all_tier_stats", tiers)?;
|
||||
state.serialize_entry("all_tier_stats", &self.all_tier_stats)?;
|
||||
// Keep the legacy no-unknown shape byte-for-byte stable. Once unknown
|
||||
// accounting exists, append its map field before the optional proof.
|
||||
if let Some(unknown_tier_stats) = self.unknown_tier_stats.as_ref() {
|
||||
@@ -1539,9 +1490,9 @@ pub fn prefix_usage_in_cache(
|
||||
} else {
|
||||
format!("{bucket}/{prefix}")
|
||||
};
|
||||
let entry = cache.get(&hash_path(&root).0)?;
|
||||
let entry = clone_cache_value(cache.get(&clone_cache_value(&hash_path(&root).0))?);
|
||||
|
||||
let usage = PrefixUsageSummary::from_entry(&flatten_entry(cache, entry, 0)?);
|
||||
let usage = PrefixUsageSummary::from_entry(&flatten_entry(cache, &entry, 0)?);
|
||||
|
||||
let child_prefix = format!("{root}/");
|
||||
let mut sub_prefixes: Vec<PrefixUsageEntry> = entry
|
||||
@@ -1710,69 +1661,28 @@ impl DataUsageCache {
|
||||
}
|
||||
|
||||
pub fn flatten(&self, root: &DataUsageEntry) -> DataUsageEntry {
|
||||
let mut aggregate = clone_cache_value(root);
|
||||
aggregate.children = HashSet::new();
|
||||
let mut current = (aggregate, root.children.iter());
|
||||
let mut ancestors = Vec::new();
|
||||
let mut visited = HashSet::new();
|
||||
loop {
|
||||
if let Some(id) = current.1.next() {
|
||||
if !visited.insert(id.as_str()) {
|
||||
continue;
|
||||
let mut root = clone_cache_value(root);
|
||||
for id in clone_cache_value(&root.children).iter() {
|
||||
if let Some(e) = self.cache.get(id) {
|
||||
let mut e = clone_cache_value(e);
|
||||
if !e.children.is_empty() {
|
||||
e = self.flatten(&e);
|
||||
}
|
||||
let Some(child) = self.cache.get(id).filter(|child| !std::ptr::eq(*child, root)) else {
|
||||
continue;
|
||||
};
|
||||
if child.children.is_empty() {
|
||||
current.0.merge(child);
|
||||
} else {
|
||||
let mut aggregate = clone_cache_value(child);
|
||||
aggregate.children = HashSet::new();
|
||||
ancestors.push(std::mem::replace(&mut current, (aggregate, child.children.iter())));
|
||||
}
|
||||
} else if let Some(mut parent) = ancestors.pop() {
|
||||
// Preserve subtree grouping for tier accounting proofs.
|
||||
parent.0.merge(¤t.0);
|
||||
current = parent;
|
||||
} else {
|
||||
return current.0;
|
||||
root.merge(&e);
|
||||
}
|
||||
}
|
||||
root.children.clear();
|
||||
root
|
||||
}
|
||||
|
||||
pub fn copy_with_children(&mut self, src: &DataUsageCache, hash: &DataUsageHash, parent: &Option<DataUsageHash>) {
|
||||
let mut visited = HashSet::new();
|
||||
self.copy_with_children_guard(src, hash, parent, &mut visited, 0);
|
||||
}
|
||||
|
||||
fn copy_with_children_guard(
|
||||
&mut self,
|
||||
src: &DataUsageCache,
|
||||
hash: &DataUsageHash,
|
||||
parent: &Option<DataUsageHash>,
|
||||
visited: &mut HashSet<String>,
|
||||
depth: usize,
|
||||
) {
|
||||
if depth > PREFIX_USAGE_MAX_DEPTH {
|
||||
return;
|
||||
}
|
||||
let key = clone_cache_value(&hash.0);
|
||||
if !visited.insert(key.clone()) {
|
||||
return;
|
||||
}
|
||||
if let Some(e) = src.cache.get(&key) {
|
||||
self.cache.insert(key.clone(), clone_cache_value(e));
|
||||
if let Some(e) = src.cache.get(&clone_cache_value(&hash.0)) {
|
||||
self.cache.insert(clone_cache_value(&hash.0), clone_cache_value(e));
|
||||
for ch in e.children.iter() {
|
||||
if *ch == key {
|
||||
if *ch == clone_cache_value(&hash.0) {
|
||||
return;
|
||||
}
|
||||
self.copy_with_children_guard(
|
||||
src,
|
||||
&DataUsageHash(clone_cache_value(ch)),
|
||||
&Some(clone_cache_value(hash)),
|
||||
visited,
|
||||
depth + 1,
|
||||
);
|
||||
self.copy_with_children(src, &DataUsageHash(clone_cache_value(ch)), &Some(clone_cache_value(hash)));
|
||||
}
|
||||
if let Some(parent) = parent {
|
||||
let p = self.cache.entry(clone_cache_value(&parent.0)).or_default();
|
||||
@@ -1782,40 +1692,32 @@ impl DataUsageCache {
|
||||
}
|
||||
|
||||
pub fn delete_recursive(&mut self, hash: &DataUsageHash) {
|
||||
let mut visited = HashSet::new();
|
||||
self.delete_recursive_guard(&hash.0, &mut visited, 0);
|
||||
}
|
||||
|
||||
fn delete_recursive_guard(&mut self, path: &str, visited: &mut HashSet<String>, depth: usize) {
|
||||
if depth > PREFIX_USAGE_MAX_DEPTH {
|
||||
return;
|
||||
}
|
||||
let key = clone_cache_value(path);
|
||||
if !visited.insert(key.clone()) {
|
||||
return;
|
||||
}
|
||||
let mut need_remove = Vec::new();
|
||||
if let Some(v) = self.cache.get(&key) {
|
||||
if let Some(v) = self.cache.get(&clone_cache_value(&hash.0)) {
|
||||
for child in v.children.iter() {
|
||||
need_remove.push(clone_cache_value(child));
|
||||
}
|
||||
}
|
||||
self.cache.remove(&key);
|
||||
self.cache.remove(&clone_cache_value(&hash.0));
|
||||
need_remove.iter().for_each(|child| {
|
||||
self.delete_recursive_guard(child, visited, depth + 1);
|
||||
self.delete_recursive(&DataUsageHash(clone_cache_value(child)));
|
||||
});
|
||||
}
|
||||
|
||||
pub fn size_recursive(&self, path: &str) -> Option<DataUsageEntry> {
|
||||
let root = self.cache.get(&hash_path(path).0)?;
|
||||
if root.children.is_empty() {
|
||||
return Some(clone_cache_value(root));
|
||||
match self.find(path) {
|
||||
Some(root) => {
|
||||
if root.children.is_empty() {
|
||||
return Some(root);
|
||||
}
|
||||
let mut flat = self.flatten(&root);
|
||||
if flat.replication_stats.as_ref().is_some_and(ReplicationAllStats::is_empty) {
|
||||
flat.replication_stats = None;
|
||||
}
|
||||
Some(flat)
|
||||
}
|
||||
None => None,
|
||||
}
|
||||
let mut flat = self.flatten(root);
|
||||
if flat.replication_stats.as_ref().is_some_and(ReplicationAllStats::is_empty) {
|
||||
flat.replication_stats = None;
|
||||
}
|
||||
Some(flat)
|
||||
}
|
||||
|
||||
pub fn search_parent(&self, hash: &DataUsageHash) -> Option<DataUsageHash> {
|
||||
@@ -1937,17 +1839,6 @@ impl DataUsageCache {
|
||||
}
|
||||
|
||||
pub fn total_children_rec(&self, path: &str) -> usize {
|
||||
let mut visited = HashSet::new();
|
||||
self.total_children_rec_guard(path, &mut visited, 0)
|
||||
}
|
||||
|
||||
fn total_children_rec_guard(&self, path: &str, visited: &mut HashSet<String>, depth: usize) -> usize {
|
||||
if depth > PREFIX_USAGE_MAX_DEPTH {
|
||||
return 0;
|
||||
}
|
||||
if !visited.insert(clone_cache_value(path)) {
|
||||
return 0;
|
||||
}
|
||||
let Some(root) = self.find(path) else {
|
||||
return 0;
|
||||
};
|
||||
@@ -1957,7 +1848,7 @@ impl DataUsageCache {
|
||||
|
||||
let mut n = root.children.len();
|
||||
for ch in root.children.iter() {
|
||||
n += self.total_children_rec_guard(ch, visited, depth + 1);
|
||||
n += self.total_children_rec(ch);
|
||||
}
|
||||
n
|
||||
}
|
||||
@@ -2007,17 +1898,19 @@ impl DataUsageCache {
|
||||
|
||||
/// Convert cache to DataUsageInfo for a specific path
|
||||
pub fn dui(&self, path: &str, buckets: &[String]) -> DataUsageInfo {
|
||||
let Some(e) = self.cache.get(&hash_path(path).0) else {
|
||||
return DataUsageInfo::default();
|
||||
let e = match self.find(path) {
|
||||
Some(e) => e,
|
||||
None => return DataUsageInfo::default(),
|
||||
};
|
||||
let flat = self.flatten(e);
|
||||
let flat = self.flatten(&e);
|
||||
|
||||
let mut buckets_usage = HashMap::new();
|
||||
for bucket_name in buckets.iter() {
|
||||
let Some(e) = self.cache.get(&hash_path(bucket_name).0) else {
|
||||
continue;
|
||||
let e = match self.find(bucket_name) {
|
||||
Some(e) => e,
|
||||
None => continue,
|
||||
};
|
||||
let flat = self.flatten(e);
|
||||
let flat = self.flatten(&e);
|
||||
let mut bui = BucketUsageInfo {
|
||||
size: flat.size as u64,
|
||||
versions_count: flat.versions as u64,
|
||||
@@ -2635,32 +2528,6 @@ mod tests {
|
||||
entry
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ordered_checkpoint_entry_round_trips_and_stays_identical_after_reload() {
|
||||
let mut entry = DataUsageEntry::default();
|
||||
let mut replication = ReplicationAllStats {
|
||||
replica_size: 998,
|
||||
replica_count: 3,
|
||||
..Default::default()
|
||||
};
|
||||
let mut tiers = AllTierStats::default();
|
||||
for index in 1..=32 {
|
||||
let key = format!("source-{index}");
|
||||
entry.children.insert(key.clone());
|
||||
replication.targets.insert(key.clone(), ReplicationTargetUsage::default());
|
||||
tiers.tiers.insert(key, TierStats::default());
|
||||
}
|
||||
entry.replication_stats = Some(replication);
|
||||
entry.all_tier_stats = Some(tiers);
|
||||
let bytes = rmp_serde::to_vec(&entry.ordered_encoding()).expect("encode ordered checkpoint");
|
||||
let reloaded: DataUsageEntry = rmp_serde::from_slice(&bytes).expect("read with the existing codec");
|
||||
assert_eq!(reloaded.children, entry.children);
|
||||
let replicas = reloaded.replication_stats.as_ref().expect("replication stats");
|
||||
assert_eq!((replicas.targets.len(), replicas.replica_size, replicas.replica_count), (32, 998, 3));
|
||||
assert_eq!(reloaded.all_tier_stats.as_ref().expect("tier stats").tiers.len(), 32);
|
||||
assert_eq!(rmp_serde::to_vec(&reloaded.ordered_encoding()).expect("encode reloaded entry"), bytes);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tier_stats_survive_entry_merge() {
|
||||
let mut left = tier_entry(
|
||||
@@ -4171,17 +4038,6 @@ mod tests {
|
||||
(cache, root)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_flatten_aggregates_nested_siblings() {
|
||||
let (cache, root) = build_test_tree();
|
||||
let root_entry = cache.cache.get(&root.0).expect("usage root");
|
||||
let flattened = cache.flatten(root_entry);
|
||||
assert!(flattened.children.is_empty());
|
||||
assert_eq!(flattened.objects, 6);
|
||||
assert_eq!(flattened.size, 60);
|
||||
assert_eq!(root_entry.children.len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_add_collects_internal_nodes_as_compaction_candidates() {
|
||||
let (cache, root) = build_test_tree();
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
pub mod data_usage;
|
||||
pub mod scan_progress;
|
||||
pub mod usage_observation;
|
||||
|
||||
pub use data_usage::*;
|
||||
pub use scan_progress::*;
|
||||
pub use usage_observation::*;
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
// Copyright 2026 RustFS Team
|
||||
// Licensed under the Apache License, Version 2.0.
|
||||
|
||||
//! Display-only scanner progress. These values never authorize quota admission,
|
||||
//! cache reuse, or publication of a certified usage snapshot.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
pub const BUCKET_SCAN_PROGRESS_VERSION: u16 = 1;
|
||||
pub const BUCKET_SCAN_PROGRESS_MAX_BYTES: usize = 16 * 1024;
|
||||
pub const BUCKET_SCAN_PROGRESS_OBJECT_NAME: &str = ".usage-progress.json";
|
||||
|
||||
/// The object lives on its contributing erasure set, alongside its bucket cache.
|
||||
pub fn bucket_scan_progress_path(bucket: &str) -> String {
|
||||
format!("buckets/{bucket}/{BUCKET_SCAN_PROGRESS_OBJECT_NAME}")
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum BucketScanStage {
|
||||
Enumerating,
|
||||
Scanning,
|
||||
AwaitingSources,
|
||||
Completed,
|
||||
}
|
||||
|
||||
/// One replaceable sample from a logical erasure set, never a per-disk delta.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub struct BucketScanProgressSource {
|
||||
pub version: u16,
|
||||
pub bucket: String,
|
||||
pub bucket_incarnation: String,
|
||||
pub pool_index: u64,
|
||||
pub set_index: u64,
|
||||
pub set_layout: [u8; 32],
|
||||
pub publication_epoch: u64,
|
||||
/// Shared durable movement scope. A writer's local admission epoch is not
|
||||
/// comparable to another node's counter, including after restart.
|
||||
#[serde(default)]
|
||||
pub movement_generation: Option<u64>,
|
||||
pub scanner_epoch: u64,
|
||||
pub scanner_cycle: u64,
|
||||
/// Unix milliseconds of the sample, preserved when an older sample is carried.
|
||||
pub updated_at: u64,
|
||||
pub stage: BucketScanStage,
|
||||
/// Accepted logical object usage; enumeration alone leaves both absent.
|
||||
pub objects: Option<u64>,
|
||||
pub size: Option<u64>,
|
||||
}
|
||||
|
||||
/// Response-only progress, deliberately separate from a bucket's total usage.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub struct BucketScanProgress {
|
||||
pub stage: BucketScanStage,
|
||||
pub updated_at: u64,
|
||||
pub objects: Option<u64>,
|
||||
pub size: Option<u64>,
|
||||
pub sources_observed: u64,
|
||||
pub sources_total: u64,
|
||||
}
|
||||
|
||||
impl BucketScanProgressSource {
|
||||
/// Bind a sample to shared storage scope, independently of reader-local epochs.
|
||||
pub fn matches(&self, bucket: &str, incarnation: &str, source: (u64, u64), movement_generation: u64) -> bool {
|
||||
self.version == BUCKET_SCAN_PROGRESS_VERSION
|
||||
&& self.bucket == bucket
|
||||
&& !incarnation.is_empty()
|
||||
&& incarnation != "00000000-0000-0000-0000-000000000000"
|
||||
&& self.bucket_incarnation == incarnation
|
||||
&& (self.pool_index, self.set_index) == source
|
||||
&& self.movement_generation == Some(movement_generation)
|
||||
&& self.updated_at > 0
|
||||
&& self.objects.is_some() == self.size.is_some()
|
||||
&& (self.stage != BucketScanStage::Completed || self.objects.is_some())
|
||||
&& self.stage != BucketScanStage::AwaitingSources
|
||||
}
|
||||
}
|
||||
|
||||
/// Fold each logical source exactly once. Retries replace samples; replicas do
|
||||
/// not add to them. Missing sources remain explicit, including on first startup.
|
||||
/// Overflow or conflicting copies of a source make the view unavailable.
|
||||
/// Callers first bind each sample to the same current bucket and movement
|
||||
/// scope with [`BucketScanProgressSource::matches`].
|
||||
pub fn aggregate_bucket_scan_progress(
|
||||
sources: impl IntoIterator<Item = BucketScanProgressSource>,
|
||||
expected: &[(u64, u64)],
|
||||
) -> Option<BucketScanProgress> {
|
||||
if expected.is_empty() || expected.windows(2).any(|pair| pair[0] >= pair[1]) {
|
||||
return None;
|
||||
}
|
||||
let mut selected = BTreeMap::new();
|
||||
for sample in sources {
|
||||
let key = (sample.pool_index, sample.set_index);
|
||||
if expected.binary_search(&key).is_err() {
|
||||
return None;
|
||||
}
|
||||
if let Some(previous) = selected.insert(key, sample.clone())
|
||||
&& previous != sample
|
||||
{
|
||||
return None;
|
||||
}
|
||||
}
|
||||
let updated_at = selected.values().map(|sample| sample.updated_at).min()?;
|
||||
let mut objects = None;
|
||||
let mut size = None;
|
||||
for sample in selected.values() {
|
||||
match (sample.objects, sample.size) {
|
||||
(Some(count), Some(bytes)) => {
|
||||
objects = Some(objects.unwrap_or(0_u64).checked_add(count)?);
|
||||
size = Some(size.unwrap_or(0_u64).checked_add(bytes)?);
|
||||
}
|
||||
(None, None) => {}
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
let complete = selected.len() == expected.len() && selected.values().all(|s| s.stage == BucketScanStage::Completed);
|
||||
Some(BucketScanProgress {
|
||||
stage: if complete {
|
||||
BucketScanStage::Completed
|
||||
} else if selected.len() < expected.len() {
|
||||
BucketScanStage::AwaitingSources
|
||||
} else if objects.is_some() {
|
||||
BucketScanStage::Scanning
|
||||
} else {
|
||||
BucketScanStage::Enumerating
|
||||
},
|
||||
updated_at,
|
||||
objects,
|
||||
size,
|
||||
sources_observed: u64::try_from(selected.len()).ok()?,
|
||||
sources_total: u64::try_from(expected.len()).ok()?,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn sample(set: u64) -> BucketScanProgressSource {
|
||||
BucketScanProgressSource {
|
||||
version: BUCKET_SCAN_PROGRESS_VERSION,
|
||||
bucket: "bucket".into(),
|
||||
bucket_incarnation: "identity".into(),
|
||||
pool_index: 0,
|
||||
set_index: set,
|
||||
set_layout: [1; 32],
|
||||
publication_epoch: 0,
|
||||
movement_generation: Some(0),
|
||||
scanner_epoch: 3,
|
||||
scanner_cycle: 4,
|
||||
updated_at: 1000,
|
||||
stage: BucketScanStage::Scanning,
|
||||
objects: Some(7),
|
||||
size: Some(77),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn repeated_source_samples_never_double_count() {
|
||||
let one = sample(0);
|
||||
let progress = aggregate_bucket_scan_progress([one.clone(), one], &[(0, 0), (0, 1)]).expect("partial progress");
|
||||
assert_eq!(progress.objects, Some(7));
|
||||
assert_eq!(progress.size, Some(77));
|
||||
assert_eq!(progress.stage, BucketScanStage::AwaitingSources);
|
||||
assert_eq!(progress.sources_observed, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enumeration_does_not_invent_empty_usage() {
|
||||
let mut one = sample(0);
|
||||
one.stage = BucketScanStage::Enumerating;
|
||||
one.objects = None;
|
||||
one.size = None;
|
||||
let progress = aggregate_bucket_scan_progress([one], &[(0, 0)]).expect("enumeration progress");
|
||||
assert_eq!(progress.objects, None);
|
||||
assert_eq!(progress.size, None);
|
||||
assert_eq!(progress.stage, BucketScanStage::Enumerating);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completion_requires_every_source_and_keeps_oldest_timestamp() {
|
||||
let mut one = sample(0);
|
||||
one.stage = BucketScanStage::Completed;
|
||||
let mut two = sample(1);
|
||||
two.updated_at = 2000;
|
||||
let pending = aggregate_bucket_scan_progress([one.clone(), two.clone()], &[(0, 0), (0, 1)]).expect("pending");
|
||||
assert_eq!(pending.stage, BucketScanStage::Scanning);
|
||||
two.stage = BucketScanStage::Completed;
|
||||
let done = aggregate_bucket_scan_progress([one, two], &[(0, 0), (0, 1)]).expect("completed");
|
||||
assert_eq!((done.objects, done.size, done.updated_at), (Some(14), Some(154), 1000));
|
||||
assert_eq!(done.stage, BucketScanStage::Completed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn conflicting_replicas_overflow_and_foreign_sources_are_rejected() {
|
||||
let mut other = sample(0);
|
||||
other.objects = Some(8);
|
||||
assert!(aggregate_bucket_scan_progress([sample(0), other], &[(0, 0)]).is_none());
|
||||
assert!(aggregate_bucket_scan_progress([sample(1)], &[(0, 0)]).is_none());
|
||||
let mut huge = sample(1);
|
||||
huge.size = Some(u64::MAX);
|
||||
assert!(aggregate_bucket_scan_progress([sample(0), huge], &[(0, 0), (0, 1)]).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn progress_cannot_cross_bucket_incarnation_or_movement_generation() {
|
||||
let one = sample(0);
|
||||
assert!(one.matches("bucket", "identity", (0, 0), 0));
|
||||
assert!(!one.matches("bucket", "recreated", (0, 0), 0));
|
||||
assert!(!one.matches("bucket", "identity", (0, 1), 0));
|
||||
assert!(!one.matches("bucket", "identity", (0, 0), 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn progress_reader_local_epoch_does_not_hide_shared_sample() {
|
||||
let mut one = sample(0);
|
||||
one.publication_epoch = 7;
|
||||
assert!(one.matches("bucket", "identity", (0, 0), 0));
|
||||
one.movement_generation = None;
|
||||
assert!(!one.matches("bucket", "identity", (0, 0), 0), "missing shared scope stays unknown");
|
||||
}
|
||||
}
|
||||
@@ -171,70 +171,6 @@ impl DataUsageBucketObservation {
|
||||
}
|
||||
|
||||
impl DataUsageInfo {
|
||||
/// Hide values that cannot be bound to the current storage-owned identity.
|
||||
///
|
||||
/// `incarnations` contains canonical non-nil identities read from storage;
|
||||
/// a missing entry means identity was unavailable. Neither legacy values
|
||||
/// without identity nor metadata read failures establish confirmed zero.
|
||||
/// Changed responses are display-only and cannot authorize quota or writes.
|
||||
/// If retained counters overflow, all values remain unknown.
|
||||
/// Returns the number of canonical values removed.
|
||||
pub fn retain_current_bucket_usage_for_admin(&mut self, incarnations: &HashMap<String, String>) -> usize {
|
||||
let original_count = self.buckets_usage.len();
|
||||
let original_observation_count = self.usage_snapshot_bucket_observations.len();
|
||||
let matches_current = |bucket: &String, usage: &BucketUsageInfo| {
|
||||
incarnations.get(bucket).is_some_and(|current| {
|
||||
!current.is_empty()
|
||||
&& current != "00000000-0000-0000-0000-000000000000"
|
||||
&& usage.bucket_incarnation.as_ref() == Some(current)
|
||||
})
|
||||
};
|
||||
self.buckets_usage.retain(|bucket, usage| matches_current(bucket, usage));
|
||||
self.usage_snapshot_bucket_observations.retain(|bucket, observation| {
|
||||
matches_current(bucket, &observation.usage)
|
||||
&& observation
|
||||
.sources
|
||||
.iter()
|
||||
.all(|source| incarnations.get(bucket) == Some(&source.bucket_incarnation))
|
||||
});
|
||||
if original_count == self.buckets_usage.len()
|
||||
&& original_observation_count == self.usage_snapshot_bucket_observations.len()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
let totals = self.buckets_usage.values().try_fold([0_u64; 4], |total, usage| {
|
||||
Some([
|
||||
total[0].checked_add(usage.size)?,
|
||||
total[1].checked_add(usage.objects_count)?,
|
||||
total[2].checked_add(usage.versions_count)?,
|
||||
total[3].checked_add(usage.delete_markers_count)?,
|
||||
])
|
||||
});
|
||||
let [size, objects, versions, markers] = totals.unwrap_or_else(|| {
|
||||
self.buckets_usage.clear();
|
||||
self.usage_snapshot_bucket_observations.clear();
|
||||
[0; 4]
|
||||
});
|
||||
self.bucket_sizes = self
|
||||
.buckets_usage
|
||||
.iter()
|
||||
.map(|(bucket, usage)| (bucket.clone(), usage.size))
|
||||
.collect();
|
||||
self.buckets_count = u64::try_from(self.buckets_usage.len()).unwrap_or(u64::MAX);
|
||||
self.objects_total_size = size;
|
||||
self.objects_total_count = objects;
|
||||
self.versions_total_count = versions;
|
||||
self.delete_markers_total_count = markers;
|
||||
self.replication_info.clear();
|
||||
self.tier_stats = None;
|
||||
self.unknown_tier_stats = None;
|
||||
self.usage_snapshot_complete = false;
|
||||
self.usage_snapshot_partial = true;
|
||||
self.usage_snapshot_converged = Some(false);
|
||||
self.usage_snapshot_admin_projection = true;
|
||||
original_count.saturating_sub(self.buckets_usage.len())
|
||||
}
|
||||
|
||||
/// Overlay validated companions on an owned admin response only.
|
||||
///
|
||||
/// `incarnations` must come from current storage metadata, not the companion.
|
||||
|
||||
@@ -321,110 +321,3 @@ fn provenance_and_companions_change_candidate_bytes_and_round_trip_as_maps() {
|
||||
let restored: DataUsageInfo = rmp_serde::from_slice(&named).expect("read named map with additive fields");
|
||||
assert_eq!(restored, canonical);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn current_identity_filter_preserves_an_unchanged_complete_snapshot() {
|
||||
let mut candidate = snapshot();
|
||||
let original = candidate.clone();
|
||||
assert_eq!(candidate.retain_current_bucket_usage_for_admin(&incarnations()), 0);
|
||||
assert_eq!(candidate, original);
|
||||
assert!(candidate.is_complete_bucket_usage_snapshot());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn current_identity_filter_hides_unbound_values_without_confirming_zero() {
|
||||
for identity in [
|
||||
None,
|
||||
Some(""),
|
||||
Some("corrupt"),
|
||||
Some("00000000-0000-0000-0000-000000000000"),
|
||||
Some("22222222-2222-4222-8222-222222222222"),
|
||||
] {
|
||||
let mut candidate = snapshot();
|
||||
candidate.usage_snapshot_bucket_observations.clear();
|
||||
candidate
|
||||
.buckets_usage
|
||||
.get_mut("bucket")
|
||||
.expect("canonical")
|
||||
.bucket_incarnation = identity.map(str::to_string);
|
||||
assert_eq!(
|
||||
candidate.retain_current_bucket_usage_for_admin(&incarnations()),
|
||||
1,
|
||||
"identity {identity:?}"
|
||||
);
|
||||
assert!(!candidate.buckets_usage.contains_key("bucket"));
|
||||
assert!(!candidate.bucket_sizes.contains_key("bucket"));
|
||||
assert_eq!(candidate.usage_snapshot_converged, Some(false));
|
||||
assert!(candidate.usage_snapshot_admin_projection);
|
||||
assert!(!candidate.is_complete_bucket_usage_snapshot());
|
||||
assert!(!candidate.is_valid_partial_snapshot());
|
||||
}
|
||||
for current in ["", "00000000-0000-0000-0000-000000000000"] {
|
||||
let mut candidate = snapshot();
|
||||
candidate
|
||||
.buckets_usage
|
||||
.get_mut("bucket")
|
||||
.expect("canonical")
|
||||
.bucket_incarnation = Some(current.to_string());
|
||||
assert_eq!(
|
||||
candidate.retain_current_bucket_usage_for_admin(&HashMap::from([("bucket".to_string(), current.to_string())])),
|
||||
1
|
||||
);
|
||||
assert!(candidate.usage_snapshot_admin_projection);
|
||||
}
|
||||
let mut candidate = snapshot();
|
||||
assert_eq!(candidate.retain_current_bucket_usage_for_admin(&HashMap::new()), 1);
|
||||
assert!(candidate.usage_snapshot_bucket_observations.is_empty());
|
||||
assert_eq!(candidate.usage_snapshot_converged, Some(false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn current_identity_filter_keeps_healthy_buckets_and_recalculates_partial_totals() {
|
||||
let mut candidate = snapshot();
|
||||
candidate.buckets_usage.insert("cold".to_string(), usage(7));
|
||||
candidate.buckets_count = 2;
|
||||
candidate.bucket_sizes.insert("cold".to_string(), 7);
|
||||
candidate.calculate_totals();
|
||||
candidate.replication_info.insert("target".to_string(), Default::default());
|
||||
candidate.tier_stats = Some(Default::default());
|
||||
candidate.unknown_tier_stats = Some(Default::default());
|
||||
assert_eq!(
|
||||
candidate.retain_current_bucket_usage_for_admin(&HashMap::from([("cold".to_string(), INCARNATION.to_string())])),
|
||||
1
|
||||
);
|
||||
assert_eq!(candidate.buckets_usage.len(), 1);
|
||||
assert_eq!(candidate.buckets_usage["cold"].size, 7);
|
||||
assert_eq!(candidate.bucket_sizes, HashMap::from([("cold".to_string(), 7)]));
|
||||
assert_eq!(
|
||||
(
|
||||
candidate.buckets_count,
|
||||
candidate.objects_total_size,
|
||||
candidate.objects_total_count,
|
||||
candidate.versions_total_count
|
||||
),
|
||||
(1, 7, 7, 7)
|
||||
);
|
||||
assert!(candidate.replication_info.is_empty());
|
||||
assert!(candidate.tier_stats.is_none());
|
||||
assert!(candidate.unknown_tier_stats.is_none());
|
||||
assert!(candidate.usage_snapshot_admin_projection);
|
||||
assert_eq!(candidate.usage_snapshot_converged, Some(false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn current_identity_filter_overflow_leaves_totals_unknown() {
|
||||
let mut candidate = snapshot();
|
||||
candidate.buckets_usage.insert("large".to_string(), usage(u64::MAX));
|
||||
candidate.buckets_usage.insert("small".to_string(), usage(1));
|
||||
candidate.buckets_count = 3;
|
||||
let current = HashMap::from([
|
||||
("large".to_string(), INCARNATION.to_string()),
|
||||
("small".to_string(), INCARNATION.to_string()),
|
||||
]);
|
||||
assert_eq!(candidate.retain_current_bucket_usage_for_admin(¤t), 3);
|
||||
assert!(candidate.buckets_usage.is_empty());
|
||||
assert!(candidate.bucket_sizes.is_empty());
|
||||
assert_eq!(candidate.usage_snapshot_converged, Some(false));
|
||||
assert!(candidate.usage_snapshot_admin_projection);
|
||||
assert!(!candidate.is_complete_bucket_usage_snapshot());
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ rustfs-madmin.workspace = true
|
||||
rustfs-filemeta.workspace = true
|
||||
bytes = { workspace = true, features = ["serde"] }
|
||||
aws-sdk-s3 = { workspace = true, default-features = false, features = ["sigv4a", "default-https-client", "rt-tokio"] }
|
||||
aws-sdk-sts = { workspace = true, default-features = false, features = ["default-https-client", "rt-tokio"] }
|
||||
aws-smithy-http-client = { workspace = true, default-features = false, features = ["rustls-aws-lc"] }
|
||||
aws-smithy-types.workspace = true
|
||||
async-trait = { workspace = true }
|
||||
@@ -123,12 +124,12 @@ urlencoding.workspace = true
|
||||
walkdir.workspace = true
|
||||
base64-simd = { workspace = true }
|
||||
rand = { workspace = true, features = ["serde"] }
|
||||
jiff = { workspace = true, features = ["serde"] }
|
||||
chrono = { workspace = true, features = ["serde"] }
|
||||
hex-simd = { workspace = true }
|
||||
md-5 = { workspace = true }
|
||||
prost.workspace = true
|
||||
sha2 = { workspace = true }
|
||||
rustfs-s3-types = { workspace = true }
|
||||
s3s = { workspace = true, features = ["minio"] }
|
||||
zstd.workspace = true
|
||||
time = { workspace = true, features = ["parsing", "formatting", "macros", "serde"] }
|
||||
rcgen.workspace = true
|
||||
@@ -138,16 +139,8 @@ rustls = { workspace = true, default-features = false, features = ["aws-lc-rs",
|
||||
clap = { workspace = true, features = ["derive", "env"] }
|
||||
|
||||
[dev-dependencies]
|
||||
rustfs-gateway.workspace = true
|
||||
rustfs-gateway-types.workspace = true
|
||||
rustfs-gateway-stream.workspace = true
|
||||
serde-value.workspace = true
|
||||
s3s = { git = "https://github.com/s3s-project/s3s", rev = "5761ddfe4c509fcac87e3b99fd5bd9e176b442c0", features = ["minio"] }
|
||||
s3s-sigv4 = { git = "https://github.com/s3s-project/s3s", rev = "5761ddfe4c509fcac87e3b99fd5bd9e176b442c0" }
|
||||
url.workspace = true
|
||||
async-compression = { workspace = true, features = ["tokio", "bzip2", "lz4", "xz"] }
|
||||
aws-config = { workspace = true }
|
||||
aws-sdk-sts = { workspace = true, default-features = false, features = ["default-https-client", "rt-tokio"] }
|
||||
opentelemetry-proto = { workspace = true }
|
||||
russh = { workspace = true, features = ["serde"] }
|
||||
russh-sftp = { workspace = true }
|
||||
|
||||
@@ -29,7 +29,7 @@ Registered in [`src/lib.rs`](src/lib.rs). Grouped by concern:
|
||||
| **distributed 4×4** | [`src/distributed/`](src/distributed) | Nightly `e2e-distributed` lane: S3, object lock/WORM, versioning, bucket/site replication, quota, expand/decommission/rebalance, concurrency, chaos, 4-node upgrade of historical data and IAM AK/SK. Map: [`docs/testing/distributed-e2e.md`](../../docs/testing/distributed-e2e.md) |
|
||||
| **chaos / reliability** | [`src/chaos.rs`](src/chaos.rs), `reliability_disk_fault_test`, `heal_erasure_disk_rebuild_test`, `server_startup_failfast_test` | Disk offline/replace/corrupt, EC rebuild, heal, fail-fast startup |
|
||||
| **upgrade compatibility** | `upgrade_compatibility_test` | Pinned previous-release writes followed by current-build reads on the same data directory |
|
||||
| **dual-stack differential** | `dual_stack_differential` | Two single-node servers answer one SDK script for all 73 S3 operations and every differing `(op, field, a, b)` is reported. Both sides run the binary under test on its only (gateway) stack unless `RUSTFS_E2E_REFERENCE_BINARY` names a released `rustfs` binary, which then runs side A. A missing, non-file or non-executable path fails the run; it never skips or falls back to the same-binary mode. `RUSTFS_E2E_STACK_B_REGION` starts side B in another region to inject a difference. The report in `<target>/dual-stack/<run>.json` records `reference_side` and each side's `--version` output |
|
||||
| **dual-stack differential** | `dual_stack_differential` | Two single-node servers answer one SDK script for all 73 S3 operations and every differing `(op, field, a, b)` is reported. Side A is the binary under test on `RUSTFS_S3_STACK=legacy`; side B runs `RUSTFS_E2E_STACK_B`. Set `RUSTFS_E2E_REFERENCE_BINARY` to a released `rustfs` binary to make side A that binary instead (started without `RUSTFS_S3_STACK`, which older releases do not know). A missing, non-file or non-executable path fails the run; it never skips or falls back to the same-binary mode. The report in `<target>/dual-stack/<run>.json` records `reference_side` and each side's `--version` output |
|
||||
|
||||
The external-tool `storage_metric_ownership_test` validates the OTLP/Collector/Prometheus path, including a rolling upgrade and node failures. See the [storage metrics guide](../../docs/operations/storage-metrics.md) for its required binaries and focused command.
|
||||
|
||||
@@ -211,8 +211,6 @@ the wiring source of truth. Committed test-ID digests under
|
||||
|
||||
**Endpoint blackhole scenario skipped** — `heal_erasure_disk_rebuild_test::tests::test_cluster_root_heal_recovers_after_target_endpoint_blackhole` installs a loopback `iptables` DROP rule and therefore needs `CAP_NET_ADMIN` (root or passwordless `sudo -n iptables`). A host where `iptables` is missing or cannot read the OUTPUT chain (typical inside an unprivileged container, where the nf_tables backend reports "Permission denied" even under `sudo`) logs a `heal_interruption_skipped` warning and returns without exercising heal. Set `RUSTFS_E2E_REQUIRE_NET_FAULT_INJECTION=1` on lanes that do provision the capability so a broken runner fails instead of skipping.
|
||||
|
||||
The full suite compares persisted bucket configurations and object records against the release pinned in `.config/reference-binary.toml`. Set `RUSTFS_PERSISTENCE_REFERENCE_BINARY` to the verified executable and `RUSTFS_PERSISTENCE_CLOCK_LIBRARY` to the absolute path of libfaketime (`libfaketime.so.1` on Linux or `libfaketime.1.dylib` on macOS). To retain the two sets of 13 XML documents for the gateway golden corpus, set `RUSTFS_PERSISTENCE_XML_DIR` to an output directory. CI includes them in the full suite's JUnit artifact.
|
||||
|
||||
**Reproduce a CI failure locally** — run the exact profile/lane:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -1,587 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
// Exercise the production validator at the protocol boundary without importing the server crate.
|
||||
#[path = "../../../rustfs/src/storage/authorization/admission/request_validation.rs"]
|
||||
mod request_validation;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use http::{Extensions, HeaderMap, Method, Request, StatusCode, Uri};
|
||||
use http_body_util::BodyExt;
|
||||
use request_validation::{RequestViolation, validate_method_subresource};
|
||||
use s3s::access::{S3Access, S3AccessContext};
|
||||
use s3s::auth::SimpleAuth;
|
||||
use s3s::dto::{
|
||||
AbortMultipartUploadInput, AbortMultipartUploadOutput, DeleteBucketInput, DeleteBucketOutput, DeleteBucketPolicyInput,
|
||||
DeleteBucketPolicyOutput, DeleteObjectInput, DeleteObjectOutput, DeleteObjectTaggingInput, DeleteObjectTaggingOutput,
|
||||
GetBucketAclInput, GetBucketAclOutput, GetObjectAclInput, GetObjectAclOutput, GetObjectInput, GetObjectOutput,
|
||||
HeadBucketInput, HeadBucketOutput, PutBucketAclInput, PutBucketAclOutput, PutObjectAclInput, PutObjectAclOutput,
|
||||
StreamingBlob,
|
||||
};
|
||||
use s3s::host::SingleDomain;
|
||||
use s3s::route::S3Route;
|
||||
use s3s::service::{S3Service, S3ServiceBuilder};
|
||||
use s3s::{Body, S3Request, S3Response, S3Result, s3_error};
|
||||
use s3s_sigv4::{
|
||||
AmzDate, EMPTY_STRING_SHA256_HASH, Payload, calculate_signature, create_canonical_request,
|
||||
create_presigned_canonical_request, create_string_to_sign,
|
||||
};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use time::{OffsetDateTime, macros::format_description};
|
||||
|
||||
#[derive(Default)]
|
||||
struct State {
|
||||
object_deleted: bool,
|
||||
bucket_deleted: bool,
|
||||
calls: Vec<(&'static str, Option<String>)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
struct ProbeS3(Arc<Mutex<State>>);
|
||||
|
||||
#[async_trait]
|
||||
impl s3s::S3 for ProbeS3 {
|
||||
async fn delete_object(&self, req: S3Request<DeleteObjectInput>) -> S3Result<S3Response<DeleteObjectOutput>> {
|
||||
let mut state = self.0.lock().expect("probe state");
|
||||
state.object_deleted = true;
|
||||
state.calls.push(("DeleteObject", req.input.version_id));
|
||||
Ok(S3Response::new(DeleteObjectOutput::default()))
|
||||
}
|
||||
|
||||
async fn delete_bucket(&self, _: S3Request<DeleteBucketInput>) -> S3Result<S3Response<DeleteBucketOutput>> {
|
||||
let mut state = self.0.lock().expect("probe state");
|
||||
state.bucket_deleted = true;
|
||||
state.calls.push(("DeleteBucket", None));
|
||||
Ok(S3Response::new(DeleteBucketOutput::default()))
|
||||
}
|
||||
|
||||
async fn get_object(&self, _: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> {
|
||||
if self.0.lock().expect("probe state").object_deleted {
|
||||
return Err(s3_error!(NoSuchKey));
|
||||
}
|
||||
Ok(S3Response::new(GetObjectOutput {
|
||||
body: Some(StreamingBlob::from(Body::from("original object".to_owned()))),
|
||||
..Default::default()
|
||||
}))
|
||||
}
|
||||
|
||||
async fn head_bucket(&self, _: S3Request<HeadBucketInput>) -> S3Result<S3Response<HeadBucketOutput>> {
|
||||
if self.0.lock().expect("probe state").bucket_deleted {
|
||||
return Err(s3_error!(NoSuchBucket));
|
||||
}
|
||||
Ok(S3Response::new(HeadBucketOutput::default()))
|
||||
}
|
||||
|
||||
async fn delete_object_tagging(
|
||||
&self,
|
||||
req: S3Request<DeleteObjectTaggingInput>,
|
||||
) -> S3Result<S3Response<DeleteObjectTaggingOutput>> {
|
||||
self.0
|
||||
.lock()
|
||||
.expect("probe state")
|
||||
.calls
|
||||
.push(("DeleteObjectTagging", req.input.version_id));
|
||||
Ok(S3Response::new(DeleteObjectTaggingOutput::default()))
|
||||
}
|
||||
|
||||
async fn abort_multipart_upload(
|
||||
&self,
|
||||
req: S3Request<AbortMultipartUploadInput>,
|
||||
) -> S3Result<S3Response<AbortMultipartUploadOutput>> {
|
||||
self.0
|
||||
.lock()
|
||||
.expect("probe state")
|
||||
.calls
|
||||
.push(("AbortMultipartUpload", Some(req.input.upload_id)));
|
||||
Ok(S3Response::new(AbortMultipartUploadOutput::default()))
|
||||
}
|
||||
|
||||
async fn delete_bucket_policy(
|
||||
&self,
|
||||
_: S3Request<DeleteBucketPolicyInput>,
|
||||
) -> S3Result<S3Response<DeleteBucketPolicyOutput>> {
|
||||
self.0.lock().expect("probe state").calls.push(("DeleteBucketPolicy", None));
|
||||
Ok(S3Response::new(DeleteBucketPolicyOutput::default()))
|
||||
}
|
||||
|
||||
async fn get_object_acl(&self, _: S3Request<GetObjectAclInput>) -> S3Result<S3Response<GetObjectAclOutput>> {
|
||||
self.0.lock().expect("probe state").calls.push(("GetObjectAcl", None));
|
||||
Ok(S3Response::new(GetObjectAclOutput::default()))
|
||||
}
|
||||
|
||||
async fn put_object_acl(&self, _: S3Request<PutObjectAclInput>) -> S3Result<S3Response<PutObjectAclOutput>> {
|
||||
self.0.lock().expect("probe state").calls.push(("PutObjectAcl", None));
|
||||
Ok(S3Response::new(PutObjectAclOutput::default()))
|
||||
}
|
||||
|
||||
async fn get_bucket_acl(&self, _: S3Request<GetBucketAclInput>) -> S3Result<S3Response<GetBucketAclOutput>> {
|
||||
self.0.lock().expect("probe state").calls.push(("GetBucketAcl", None));
|
||||
Ok(S3Response::new(GetBucketAclOutput::default()))
|
||||
}
|
||||
|
||||
async fn put_bucket_acl(&self, _: S3Request<PutBucketAclInput>) -> S3Result<S3Response<PutBucketAclOutput>> {
|
||||
self.0.lock().expect("probe state").calls.push(("PutBucketAcl", None));
|
||||
Ok(S3Response::new(PutBucketAclOutput::default()))
|
||||
}
|
||||
}
|
||||
|
||||
struct CustomRoute;
|
||||
|
||||
struct MethodValidation;
|
||||
|
||||
#[async_trait]
|
||||
impl S3Access for MethodValidation {
|
||||
async fn check(&self, context: &mut S3AccessContext<'_>) -> S3Result<()> {
|
||||
validate_method_subresource(context.method(), context.uri().query()).map_err(|violation| match violation {
|
||||
RequestViolation::DeleteAcl => s3_error!(MethodNotAllowed),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct CustomRouteMatched;
|
||||
|
||||
#[async_trait]
|
||||
impl S3Route for CustomRoute {
|
||||
fn is_match(&self, _: &Method, uri: &Uri, _: &HeaderMap, extensions: &mut Extensions) -> bool {
|
||||
if uri.path() == "/custom" {
|
||||
extensions.insert(CustomRouteMatched);
|
||||
return true;
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
async fn check_access(&self, req: &mut S3Request<Body>) -> S3Result<()> {
|
||||
assert!(req.extensions.get::<CustomRouteMatched>().is_some());
|
||||
if req.headers.contains_key("x-test-deny") {
|
||||
return Err(s3_error!(AccessDenied));
|
||||
}
|
||||
assert!(req.credentials.is_some(), "custom route retains verified credentials");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn call(&self, req: S3Request<Body>) -> S3Result<S3Response<Body>> {
|
||||
assert!(req.extensions.get::<CustomRouteMatched>().is_some());
|
||||
Ok(S3Response::new(Body::from("custom route".to_owned())))
|
||||
}
|
||||
}
|
||||
|
||||
fn service(virtual_host: bool) -> (S3Service, ProbeS3) {
|
||||
let probe = ProbeS3::default();
|
||||
let mut builder = S3ServiceBuilder::new(probe.clone());
|
||||
builder.set_auth(SimpleAuth::from_single("test-key", "test-secret"));
|
||||
builder.set_access(MethodValidation);
|
||||
builder.set_route(CustomRoute);
|
||||
let mut config = s3s::config::S3Config::default();
|
||||
config.enable_sig_v2 = true;
|
||||
config.normalize_forward_slash_path = true;
|
||||
builder.set_config(Arc::new(s3s::config::StaticConfigProvider::new(Arc::new(config))));
|
||||
if virtual_host {
|
||||
builder.set_host(SingleDomain::new("s3.example.test").expect("test domain"));
|
||||
}
|
||||
(builder.build(), probe)
|
||||
}
|
||||
|
||||
fn signed_request(method: Method, uri: &str, presigned: bool, secret: &str) -> Request<Body> {
|
||||
signed_request_with_credentials(method, uri, presigned, "test-key", secret)
|
||||
}
|
||||
|
||||
fn signed_request_with_credentials(method: Method, uri: &str, presigned: bool, access_key: &str, secret: &str) -> Request<Body> {
|
||||
let uri: Uri = uri.parse().expect("test URI");
|
||||
let host = uri.authority().expect("test authority").as_str();
|
||||
let timestamp = OffsetDateTime::now_utc()
|
||||
.format(format_description!("[year][month][day]T[hour][minute][second]Z"))
|
||||
.expect("format SigV4 timestamp");
|
||||
let date = AmzDate::parse(×tamp).expect("test date");
|
||||
let credential = format!("{access_key}/{}/us-east-1/s3/aws4_request", date.fmt_date());
|
||||
let mut query: Vec<(String, String)> = url::form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes())
|
||||
.into_owned()
|
||||
.collect();
|
||||
let mut request = Request::builder()
|
||||
.method(method.clone())
|
||||
.header("host", host)
|
||||
.header("content-length", "0");
|
||||
if presigned {
|
||||
query.extend([
|
||||
("X-Amz-Algorithm".into(), "AWS4-HMAC-SHA256".into()),
|
||||
("X-Amz-Credential".into(), credential),
|
||||
("X-Amz-Date".into(), timestamp),
|
||||
("X-Amz-Expires".into(), "300".into()),
|
||||
("X-Amz-SignedHeaders".into(), "host".into()),
|
||||
]);
|
||||
let canonical = create_presigned_canonical_request(method.as_str(), uri.path(), &query, [("host", host)]);
|
||||
let to_sign = create_string_to_sign(&canonical, &date, "us-east-1", "s3");
|
||||
query.push(("X-Amz-Signature".into(), calculate_signature(&to_sign, secret, &date, "us-east-1", "s3")));
|
||||
let query = url::form_urlencoded::Serializer::new(String::new())
|
||||
.extend_pairs(&query)
|
||||
.finish();
|
||||
request = request.uri(format!("http://{host}{}?{query}", uri.path()));
|
||||
} else {
|
||||
let canonical = create_canonical_request(
|
||||
method.as_str(),
|
||||
uri.path(),
|
||||
&query,
|
||||
[
|
||||
("host", host),
|
||||
("x-amz-content-sha256", EMPTY_STRING_SHA256_HASH),
|
||||
("x-amz-date", ×tamp),
|
||||
],
|
||||
Payload::SingleChunk(EMPTY_STRING_SHA256_HASH),
|
||||
);
|
||||
let to_sign = create_string_to_sign(&canonical, &date, "us-east-1", "s3");
|
||||
let signature = calculate_signature(&to_sign, secret, &date, "us-east-1", "s3");
|
||||
request = request
|
||||
.uri(uri.clone())
|
||||
.header("x-amz-date", timestamp)
|
||||
.header("x-amz-content-sha256", EMPTY_STRING_SHA256_HASH)
|
||||
.header("authorization", format!("AWS4-HMAC-SHA256 Credential={credential}, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature={signature}"));
|
||||
}
|
||||
request.body(Body::empty()).expect("signed request")
|
||||
}
|
||||
|
||||
async fn response(service: &S3Service, request: Request<Body>) -> (StatusCode, String) {
|
||||
let response = service.call(request).await.expect("S3 service response");
|
||||
let status = response.status();
|
||||
let bytes = response.into_body().collect().await.expect("response body").to_bytes();
|
||||
(status, String::from_utf8(bytes.to_vec()).expect("UTF-8 test response"))
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_preserves_objects_and_buckets_for_signed_requests() {
|
||||
for virtual_host in [false, true] {
|
||||
let base = if virtual_host {
|
||||
"http://bucket.s3.example.test"
|
||||
} else {
|
||||
"http://s3.example.test/bucket"
|
||||
};
|
||||
for presigned in [false, true] {
|
||||
let (service, probe) = service(virtual_host);
|
||||
for path in ["", "/", "/key"] {
|
||||
for query in [
|
||||
"acl",
|
||||
"acl=",
|
||||
"%61cl",
|
||||
"a%63l=anything",
|
||||
"acl&acl=",
|
||||
"acl&versionId=version-1",
|
||||
"acl&tagging",
|
||||
"acl&uploadId=upload-1",
|
||||
] {
|
||||
let uri = format!("{base}{path}?{query}");
|
||||
let (status, body) = response(&service, signed_request(Method::DELETE, &uri, presigned, "test-secret")).await;
|
||||
assert_eq!(status, StatusCode::METHOD_NOT_ALLOWED, "{uri}: {body}");
|
||||
assert!(body.contains("<Code>MethodNotAllowed</Code>"), "{uri}: {body}");
|
||||
}
|
||||
let operation = if path == "/key" { "DeleteObject" } else { "DeleteBucket" };
|
||||
let uri = format!("{base}{path}?acl&x-id={operation}");
|
||||
let (status, body) = response(&service, signed_request(Method::DELETE, &uri, presigned, "test-secret")).await;
|
||||
assert_eq!(status, StatusCode::METHOD_NOT_ALLOWED, "{uri}: {body}");
|
||||
}
|
||||
assert!(
|
||||
probe.0.lock().expect("probe state").calls.is_empty(),
|
||||
"refused requests must not reach S3 handlers"
|
||||
);
|
||||
let (status, body) =
|
||||
response(&service, signed_request(Method::GET, &format!("{base}/key"), presigned, "test-secret")).await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
assert_eq!(body, "original object");
|
||||
let (status, _) =
|
||||
response(&service, signed_request(Method::HEAD, &format!("{base}/"), presigned, "test-secret")).await;
|
||||
assert_eq!(status, StatusCode::OK, "bucket must still exist");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_keeps_signature_verification_before_method_rejection() {
|
||||
let (service, probe) = service(false);
|
||||
for presigned in [false, true] {
|
||||
for query in ["acl", "versionId=version-1"] {
|
||||
let uri = format!("http://s3.example.test/bucket/key?{query}");
|
||||
let (status, body) = response(&service, signed_request(Method::DELETE, &uri, presigned, "wrong-secret")).await;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN);
|
||||
assert!(body.contains("<Code>SignatureDoesNotMatch</Code>"), "{body}");
|
||||
}
|
||||
}
|
||||
assert!(probe.0.lock().expect("probe state").calls.is_empty());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_keeps_supported_s3_operations_and_parameters() {
|
||||
for presigned in [false, true] {
|
||||
for (method, path, operation, parameter) in [
|
||||
(Method::DELETE, "/bucket/key", "DeleteObject", None),
|
||||
(Method::DELETE, "/bucket/key?versionId=version-1", "DeleteObject", Some("version-1")),
|
||||
(
|
||||
Method::DELETE,
|
||||
"/bucket/key?versionId=null&x-id=DeleteObject",
|
||||
"DeleteObject",
|
||||
Some("null"),
|
||||
),
|
||||
(Method::DELETE, "/bucket/key?custom=value&other=acl", "DeleteObject", None),
|
||||
(Method::DELETE, "/bucket/key?ACL&acl-extra&%2561cl", "DeleteObject", None),
|
||||
(
|
||||
Method::DELETE,
|
||||
"/bucket/key?tagging&versionId=version-1",
|
||||
"DeleteObjectTagging",
|
||||
Some("version-1"),
|
||||
),
|
||||
(Method::DELETE, "/bucket/key?uploadId=upload-1", "AbortMultipartUpload", Some("upload-1")),
|
||||
(Method::DELETE, "/bucket", "DeleteBucket", None),
|
||||
(Method::DELETE, "/bucket?policy", "DeleteBucketPolicy", None),
|
||||
(Method::GET, "/bucket/key?acl", "GetObjectAcl", None),
|
||||
(Method::PUT, "/bucket/key?acl", "PutObjectAcl", None),
|
||||
(Method::GET, "/bucket?acl", "GetBucketAcl", None),
|
||||
(Method::PUT, "/bucket?acl", "PutBucketAcl", None),
|
||||
] {
|
||||
let (service, probe) = service(false);
|
||||
let uri = format!("http://s3.example.test{path}");
|
||||
let (status, body) = response(&service, signed_request(method, &uri, presigned, "test-secret")).await;
|
||||
assert!(status.is_success(), "{operation} {uri}: {status} {body}");
|
||||
assert_eq!(probe.0.lock().expect("probe state").calls, [(operation, parameter.map(str::to_owned))]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_preserves_custom_route_matching_and_access() {
|
||||
let (service, probe) = service(false);
|
||||
for presigned in [false, true] {
|
||||
let uri = "http://s3.example.test/custom?acl";
|
||||
let (status, body) = response(&service, signed_request(Method::DELETE, uri, presigned, "test-secret")).await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
assert_eq!(body, "custom route");
|
||||
|
||||
let mut denied = signed_request(Method::DELETE, uri, presigned, "test-secret");
|
||||
denied
|
||||
.headers_mut()
|
||||
.insert("x-test-deny", http::HeaderValue::from_static("true"));
|
||||
let (status, body) = response(&service, denied).await;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN);
|
||||
assert!(body.contains("<Code>AccessDenied</Code>"));
|
||||
}
|
||||
assert!(probe.0.lock().expect("probe state").calls.is_empty());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_preserves_sigv2_header_and_query_authentication() {
|
||||
for presigned in [false, true] {
|
||||
for (query, secret, expected_status, expected_code) in [
|
||||
("acl", "test-secret", StatusCode::METHOD_NOT_ALLOWED, Some("MethodNotAllowed")),
|
||||
("acl", "wrong-secret", StatusCode::FORBIDDEN, Some("SignatureDoesNotMatch")),
|
||||
("versionId=version-1", "test-secret", StatusCode::NO_CONTENT, None),
|
||||
] {
|
||||
let (service, probe) = service(false);
|
||||
let date = OffsetDateTime::now_utc()
|
||||
.format(format_description!(
|
||||
"[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"
|
||||
))
|
||||
.expect("format SigV2 HTTP date");
|
||||
let request = Request::builder()
|
||||
.method(Method::DELETE)
|
||||
.uri(format!("http://s3.example.test/bucket/key?{query}"))
|
||||
.header("host", "s3.example.test")
|
||||
.header("content-length", "0")
|
||||
.header("date", date)
|
||||
.body(Body::empty())
|
||||
.expect("SigV2 request");
|
||||
let request = if presigned {
|
||||
let mut request =
|
||||
rustfs_signer::try_pre_sign_v2(request, "test-key", secret, 60, false).expect("presign SigV2 request");
|
||||
let uri = request.uri().to_string();
|
||||
let (prefix, signature) = uri.rsplit_once("&Signature=").expect("SigV2 signature");
|
||||
let encoded = url::form_urlencoded::Serializer::new(String::new())
|
||||
.append_pair("Signature", signature)
|
||||
.finish();
|
||||
*request.uri_mut() = format!("{prefix}&{encoded}").parse().expect("encoded SigV2 URI");
|
||||
request
|
||||
} else {
|
||||
rustfs_signer::try_sign_v2(request, 0, "test-key", secret, false).expect("sign SigV2 request")
|
||||
};
|
||||
let (status, body) = response(&service, request).await;
|
||||
assert_eq!(status, expected_status, "{query}: {body}");
|
||||
if let Some(code) = expected_code {
|
||||
assert!(body.contains(&format!("<Code>{code}</Code>")), "{body}");
|
||||
assert!(probe.0.lock().expect("probe state").calls.is_empty());
|
||||
} else {
|
||||
assert_eq!(probe.0.lock().expect("probe state").calls, [("DeleteObject", Some("version-1".into()))]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn live_delete(
|
||||
env: &crate::common::RustFSTestEnvironment,
|
||||
path: &str,
|
||||
presigned: bool,
|
||||
secret: &str,
|
||||
) -> (StatusCode, String) {
|
||||
let request =
|
||||
signed_request_with_credentials(Method::DELETE, &format!("{}{path}", env.url), presigned, &env.access_key, secret);
|
||||
let response = crate::common::local_http_client()
|
||||
.delete(request.uri().to_string())
|
||||
.headers(request.headers().clone())
|
||||
.send()
|
||||
.await
|
||||
.expect("send signed DELETE to RustFS");
|
||||
let status = response.status();
|
||||
(status, response.text().await.expect("read DELETE response"))
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn delete_acl_admission_through_gateway_edge() {
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
use aws_sdk_s3::types::{BucketVersioningStatus, Tag, Tagging, VersioningConfiguration};
|
||||
|
||||
let mut env = crate::common::RustFSTestEnvironment::new()
|
||||
.await
|
||||
.expect("isolated S3 environment");
|
||||
env.start_rustfs_server_without_cleanup_with_env(&[("RUSTFS_REGION", "us-east-1")])
|
||||
.await
|
||||
.expect("start RustFS");
|
||||
let client = env.create_s3_client();
|
||||
let bucket = "acl-admission";
|
||||
let empty_bucket = "acl-admission-empty";
|
||||
env.create_test_bucket(bucket).await.expect("create object bucket");
|
||||
env.create_test_bucket(empty_bucket).await.expect("create empty bucket");
|
||||
client
|
||||
.put_bucket_versioning()
|
||||
.bucket(bucket)
|
||||
.versioning_configuration(
|
||||
VersioningConfiguration::builder()
|
||||
.status(BucketVersioningStatus::Enabled)
|
||||
.build(),
|
||||
)
|
||||
.send()
|
||||
.await
|
||||
.expect("enable versioning");
|
||||
let object = client
|
||||
.put_object()
|
||||
.bucket(bucket)
|
||||
.key("key")
|
||||
.body(ByteStream::from_static(b"original object"))
|
||||
.send()
|
||||
.await
|
||||
.expect("create preserved object");
|
||||
let version = object.version_id().expect("versioned object ID");
|
||||
let version_query = url::form_urlencoded::Serializer::new(String::new())
|
||||
.append_pair("versionId", version)
|
||||
.finish();
|
||||
// The gateway wire parser refuses escaped parameter names before signature verification.
|
||||
let encoded_path = format!("/{bucket}/key?%61cl&{version_query}");
|
||||
let (status, body) = live_delete(&env, &encoded_path, false, &env.secret_key).await;
|
||||
assert_eq!(status, StatusCode::BAD_REQUEST, "{encoded_path}: {body}");
|
||||
assert!(body.contains("<Code>InvalidArgument</Code>"), "{body}");
|
||||
|
||||
for presigned in [false, true] {
|
||||
// SigV4 canonicalization rejects repeated parameter names before admission.
|
||||
let repeated_path = format!("/{bucket}/key?acl&acl=&tagging");
|
||||
let (status, body) = live_delete(&env, &repeated_path, presigned, &env.secret_key).await;
|
||||
assert_eq!(status, StatusCode::BAD_REQUEST, "{repeated_path}: {body}");
|
||||
assert!(body.contains("<Code>AuthorizationHeaderMalformed</Code>"), "{body}");
|
||||
|
||||
for path in [
|
||||
format!("/{empty_bucket}?acl"),
|
||||
format!("/{bucket}/key?acl&{version_query}"),
|
||||
format!("/{bucket}/key?acl&tagging"),
|
||||
format!("/{bucket}/key?acl&uploadId=upload-1"),
|
||||
] {
|
||||
let (status, body) = live_delete(&env, &path, presigned, &env.secret_key).await;
|
||||
assert_eq!(status, StatusCode::METHOD_NOT_ALLOWED, "{path}: {body}");
|
||||
assert!(body.contains("<Code>MethodNotAllowed</Code>"), "{body}");
|
||||
let (status, body) = live_delete(&env, &path, presigned, "wrong-secret").await;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN, "{path}: {body}");
|
||||
assert!(body.contains("<Code>SignatureDoesNotMatch</Code>"), "{body}");
|
||||
}
|
||||
client
|
||||
.head_bucket()
|
||||
.bucket(empty_bucket)
|
||||
.send()
|
||||
.await
|
||||
.expect("refused DELETE preserves empty bucket");
|
||||
let current = client
|
||||
.get_object()
|
||||
.bucket(bucket)
|
||||
.key("key")
|
||||
.send()
|
||||
.await
|
||||
.expect("refused DELETE leaves the current object readable");
|
||||
assert_eq!(current.version_id(), Some(version));
|
||||
let body = current.body.collect().await.expect("read preserved object").into_bytes();
|
||||
assert_eq!(body.as_ref(), b"original object");
|
||||
|
||||
client
|
||||
.put_object_tagging()
|
||||
.bucket(bucket)
|
||||
.key("key")
|
||||
.version_id(version)
|
||||
.tagging(
|
||||
Tagging::builder()
|
||||
.tag_set(Tag::builder().key("test").value("acl").build().expect("tag"))
|
||||
.build()
|
||||
.expect("tagging"),
|
||||
)
|
||||
.send()
|
||||
.await
|
||||
.expect("set object tags");
|
||||
let path = format!("/{bucket}/key?tagging&{version_query}");
|
||||
let (status, body) = live_delete(&env, &path, presigned, &env.secret_key).await;
|
||||
assert!(status.is_success(), "{path}: {body}");
|
||||
let tags = client
|
||||
.get_object_tagging()
|
||||
.bucket(bucket)
|
||||
.key("key")
|
||||
.version_id(version)
|
||||
.send()
|
||||
.await
|
||||
.expect("read cleared tags");
|
||||
assert!(tags.tag_set().is_empty());
|
||||
|
||||
let upload = client
|
||||
.create_multipart_upload()
|
||||
.bucket(bucket)
|
||||
.key("upload")
|
||||
.send()
|
||||
.await
|
||||
.expect("start multipart upload");
|
||||
let query = url::form_urlencoded::Serializer::new(String::new())
|
||||
.append_pair("uploadId", upload.upload_id().expect("upload ID"))
|
||||
.finish();
|
||||
let path = format!("/{bucket}/upload?{query}");
|
||||
let (status, body) = live_delete(&env, &path, presigned, &env.secret_key).await;
|
||||
assert!(status.is_success(), "{path}: {body}");
|
||||
let uploads = client
|
||||
.list_multipart_uploads()
|
||||
.bucket(bucket)
|
||||
.send()
|
||||
.await
|
||||
.expect("list remaining uploads");
|
||||
assert!(uploads.uploads().is_empty());
|
||||
}
|
||||
let path = format!("/{bucket}/key?{version_query}");
|
||||
let (status, body) = live_delete(&env, &path, false, &env.secret_key).await;
|
||||
assert_eq!(status, StatusCode::NO_CONTENT, "{path}: {body}");
|
||||
let versions = client
|
||||
.list_object_versions()
|
||||
.bucket(bucket)
|
||||
.send()
|
||||
.await
|
||||
.expect("list remaining versions");
|
||||
assert!(versions.versions().is_empty());
|
||||
let (status, body) = live_delete(&env, &format!("/{empty_bucket}"), false, &env.secret_key).await;
|
||||
assert_eq!(status, StatusCode::NO_CONTENT, "{body}");
|
||||
env.stop_server();
|
||||
}
|
||||
@@ -21,8 +21,8 @@ use crate::common::{
|
||||
};
|
||||
use http::header::{AUTHORIZATION, HOST};
|
||||
use reqwest::StatusCode;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::{constants::UNSIGNED_PAYLOAD, sign_v4};
|
||||
use s3s::Body;
|
||||
use serde_json::Value;
|
||||
use std::{error::Error, time::Duration};
|
||||
|
||||
|
||||
@@ -146,11 +146,7 @@ async fn create_service_account_for(
|
||||
Some(serde_json::json!({ "targetUser": parent }).to_string()),
|
||||
)
|
||||
.await?;
|
||||
service_account_keys(&response)
|
||||
}
|
||||
|
||||
fn service_account_keys(response: &str) -> Result<(String, String), Box<dyn Error + Send + Sync>> {
|
||||
let response: serde_json::Value = serde_json::from_str(response)?;
|
||||
let response: serde_json::Value = serde_json::from_str(&response)?;
|
||||
let access_key = response["credentials"]["accessKey"]
|
||||
.as_str()
|
||||
.ok_or("service account response should contain credentials.accessKey")?
|
||||
@@ -348,134 +344,6 @@ async fn test_update_service_account_enforces_owner_and_parent_scope() -> TestRe
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_delegated_service_account_creation_through_console_sessions() -> TestResult {
|
||||
init_logging();
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
env.start_rustfs_server_without_cleanup(vec![]).await?;
|
||||
let bucket = "delegated-backups";
|
||||
let target = "backup-user";
|
||||
let operator = "backup-operator";
|
||||
let operator_secret = "operatorSecret123";
|
||||
let wildcard_admin = "backup-admin";
|
||||
let wildcard_secret = "adminSecret123";
|
||||
let s3 = env.create_s3_client();
|
||||
s3.create_bucket().bucket(bucket).send().await?;
|
||||
for (name, secret) in [
|
||||
(target, "backupSecret123"),
|
||||
(operator, operator_secret),
|
||||
(wildcard_admin, wildcard_secret),
|
||||
("other-user", "otherUserSecret123"),
|
||||
] {
|
||||
admin_ok(
|
||||
&env,
|
||||
http::Method::PUT,
|
||||
&format!("/rustfs/admin/v3/add-user?accessKey={name}"),
|
||||
Some(serde_json::json!({"secretKey":secret,"status":"enabled"}).to_string()),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
let delegation = serde_json::json!({
|
||||
"Version":"2012-10-17",
|
||||
"Statement":[
|
||||
{"Effect":"Allow","Action":"admin:CreateServiceAccount"},
|
||||
{"Effect":"Allow","Action":"sts:AssumeRole","Resource":"arn:aws:s3:::*"},
|
||||
{"Effect":"Allow","Action":"admin:CreateServiceAccountForUser","Condition":{"StringEquals":{"svc:TargetUser":target}}}
|
||||
]
|
||||
});
|
||||
let wildcard = serde_json::json!({
|
||||
"Version":"2012-10-17",
|
||||
"Statement":[
|
||||
{"Effect":"Allow","Action":"admin:*"},
|
||||
{"Effect":"Allow","Action":"sts:AssumeRole","Resource":"arn:aws:s3:::*"}
|
||||
]
|
||||
});
|
||||
for (user, name, policy) in [
|
||||
(wildcard_admin, "backup-admin-wildcard", wildcard.to_string()),
|
||||
(target, "backup-writer", bucket_rw_policy(bucket)),
|
||||
(operator, "backup-key-manager", delegation.to_string()),
|
||||
] {
|
||||
admin_ok(
|
||||
&env,
|
||||
http::Method::PUT,
|
||||
&format!("/rustfs/admin/v3/add-canned-policy?name={name}"),
|
||||
Some(policy),
|
||||
)
|
||||
.await?;
|
||||
admin_ok(
|
||||
&env,
|
||||
http::Method::POST,
|
||||
"/rustfs/admin/v3/idp/builtin/policy/attach",
|
||||
Some(serde_json::json!({"policies":[name],"user":user}).to_string()),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
for (name, secret) in [
|
||||
(operator, operator_secret),
|
||||
(wildcard_admin, wildcard_secret),
|
||||
(env.access_key.as_str(), env.secret_key.as_str()),
|
||||
] {
|
||||
let session = build_test_sts_client(&env.url, name, secret, None, "delegated-create")
|
||||
.assume_role()
|
||||
.role_arn("arn:aws:iam::123456789012:role/console")
|
||||
.role_session_name("console")
|
||||
.send()
|
||||
.await?;
|
||||
let caller = session.credentials().ok_or("missing console session")?;
|
||||
let create = |user: &str| {
|
||||
admin_request_with_session_token(
|
||||
&env.url,
|
||||
http::Method::PUT,
|
||||
"/rustfs/admin/v3/add-service-account",
|
||||
Some(serde_json::json!({"targetUser":user}).to_string()),
|
||||
caller.access_key_id(),
|
||||
caller.secret_access_key(),
|
||||
Some(caller.session_token()),
|
||||
)
|
||||
};
|
||||
let (status, response) = create(target).await?;
|
||||
assert_eq!(status, StatusCode::OK, "create for target as {name}");
|
||||
let (key, secret) = service_account_keys(&response)?;
|
||||
let client = build_s3_client(&env.url, &key, &secret);
|
||||
wait_for_s3_put(&client, bucket, "backup", Duration::from_secs(10)).await?;
|
||||
let denied = client
|
||||
.create_bucket()
|
||||
.bucket("outside-backup-policy")
|
||||
.send()
|
||||
.await
|
||||
.expect_err("target cannot create unrelated buckets");
|
||||
assert_eq!(denied.as_service_error().and_then(|e| e.code()), Some("AccessDenied"));
|
||||
if name != env.access_key {
|
||||
let (status, _) = create(&env.access_key).await?;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN, "delegated targets exclude root");
|
||||
}
|
||||
if name == operator {
|
||||
let (status, _) = create("other-user").await?;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN, "outside delegated target");
|
||||
}
|
||||
}
|
||||
let restricted = build_test_sts_client(&env.url, &env.access_key, &env.secret_key, None, "restricted-root")
|
||||
.assume_role()
|
||||
.role_arn("arn:aws:iam::123456789012:role/console")
|
||||
.role_session_name("restricted-console")
|
||||
.policy(r#"{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"admin:CreateServiceAccount"}]}"#)
|
||||
.send()
|
||||
.await?;
|
||||
let caller = restricted.credentials().ok_or("missing restricted root session")?;
|
||||
let (status, _) = admin_request_with_session_token(
|
||||
&env.url,
|
||||
http::Method::PUT,
|
||||
"/rustfs/admin/v3/add-service-account",
|
||||
Some(serde_json::json!({"targetUser":target}).to_string()),
|
||||
caller.access_key_id(),
|
||||
caller.secret_access_key(),
|
||||
Some(caller.session_token()),
|
||||
)
|
||||
.await?;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN, "restricted root session requires delegated permission");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Full user -> policy -> service-account lifecycle, proving each management
|
||||
/// call takes effect on the data plane, not just that the endpoint answers 200.
|
||||
#[tokio::test]
|
||||
|
||||
@@ -34,15 +34,12 @@
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::common::{
|
||||
AdminTransport, RustFSTestEnvironment, admin_attach_user_policy_via, admin_create_user, admin_request_with_session_token,
|
||||
init_logging, local_http_client, parse_assume_role_credentials,
|
||||
};
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, local_http_client};
|
||||
use hmac::{Hmac, KeyInit as _, Mac};
|
||||
use http::header::HOST;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use sha1::Sha1;
|
||||
use std::error::Error;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
@@ -399,54 +396,6 @@ mod tests {
|
||||
let (status, _) = signed_request(&env.url, http::Method::GET, ACCOUNT_INFO_PATH, None, user_ak, old_sk).await?;
|
||||
assert!(status.is_client_error(), "the old secret must stop working, status: {status}");
|
||||
|
||||
env.stop_server();
|
||||
drop(env);
|
||||
console_session_rotates_the_iam_password_and_revokes_the_old_session().await
|
||||
}
|
||||
|
||||
async fn console_session_rotates_the_iam_password_and_revokes_the_old_session() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
init_logging();
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
env.start_rustfs_server(vec![]).await?;
|
||||
|
||||
let user = "console-password-user";
|
||||
let old_password = uuid::Uuid::new_v4().to_string();
|
||||
let new_password = uuid::Uuid::new_v4().to_string();
|
||||
admin_create_user(&env, user, &old_password).await?;
|
||||
admin_attach_user_policy_via(AdminTransport::Signed, &env.url, &env.access_key, &env.secret_key, "readonly", user)
|
||||
.await?;
|
||||
|
||||
let (status, response) = assume_role(&env.url, user, &old_password, None).await?;
|
||||
assert_eq!(status, reqwest::StatusCode::OK, "the current password must sign in");
|
||||
let (session_key, session_secret, token) = parse_assume_role_credentials(&response)?;
|
||||
let session_request = |method, path, body| {
|
||||
admin_request_with_session_token(&env.url, method, path, body, &session_key, &session_secret, Some(&token))
|
||||
};
|
||||
let password_request = |current: &str| {
|
||||
Some(serde_json::json!({ "current_secret_key": current, "new_secret_key": new_password }).to_string())
|
||||
};
|
||||
|
||||
let (status, body) =
|
||||
session_request(http::Method::POST, ACCOUNT_PASSWORD_PATH, password_request(&session_secret)).await?;
|
||||
assert_eq!(
|
||||
status,
|
||||
reqwest::StatusCode::BAD_REQUEST,
|
||||
"the session secret must not be accepted as the IAM password"
|
||||
);
|
||||
assert!(body.contains("InvalidRequest") && body.contains("the current secret key is incorrect"));
|
||||
|
||||
let (status, body) = session_request(http::Method::POST, ACCOUNT_PASSWORD_PATH, password_request(&old_password)).await?;
|
||||
assert_eq!(status, reqwest::StatusCode::OK, "the same session must accept the current IAM password");
|
||||
assert_eq!(serde_json::from_str::<serde_json::Value>(&body)?["sessions_revoked"], 1);
|
||||
|
||||
let (status, _) = session_request(http::Method::GET, ACCOUNT_INFO_PATH, None).await?;
|
||||
assert_eq!(status, reqwest::StatusCode::FORBIDDEN, "the pre-rotation session must be revoked");
|
||||
let (status, _) = assume_role(&env.url, user, &old_password, None).await?;
|
||||
assert_eq!(status, reqwest::StatusCode::FORBIDDEN, "the old password must no longer sign in");
|
||||
let (status, response) = assume_role(&env.url, user, &new_password, None).await?;
|
||||
assert_eq!(status, reqwest::StatusCode::OK, "the new password must sign in");
|
||||
parse_assume_role_credentials(&response)?;
|
||||
|
||||
env.stop_server();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, local_http_client};
|
||||
use http::header::HOST;
|
||||
use reqwest::StatusCode;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use serde::Deserialize;
|
||||
use std::error::Error;
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ use aws_sdk_s3::primitives::ByteStream;
|
||||
use http::header::HOST;
|
||||
use reqwest::StatusCode;
|
||||
use rustfs_madmin::{ITEM_OFFLINE, InfoMessage, StorageInfo};
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use serde::Deserialize;
|
||||
use std::error::Error;
|
||||
use tokio::time::{Duration, sleep, timeout};
|
||||
|
||||
@@ -21,9 +21,9 @@ mod tests {
|
||||
use aws_sdk_s3::types::{CompletedMultipartUpload, CompletedPart};
|
||||
use http::header::{CONTENT_TYPE, HOST};
|
||||
use reqwest::StatusCode;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::{pre_sign_v4, sign_v4};
|
||||
use s3s::Body;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::error::Error;
|
||||
use std::io::{Cursor, Write};
|
||||
|
||||
@@ -137,40 +137,6 @@ async fn test_bucket_policy_authenticated_user() -> Result<(), Box<dyn std::erro
|
||||
.await
|
||||
.map_err(|e| format!("DeleteObject failed: {}", e))?;
|
||||
|
||||
for (allowed, may_read) in [("s3:GetBucketPolicy", true), ("s3:PutBucketPolicy", false)] {
|
||||
let policy = serde_json::json!({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [{
|
||||
"Effect": "Allow",
|
||||
"Principal": { "AWS": [user_access] },
|
||||
"Action": allowed,
|
||||
"Resource": format!("arn:aws:s3:::{bucket_name}")
|
||||
}]
|
||||
})
|
||||
.to_string();
|
||||
admin_client
|
||||
.put_bucket_policy()
|
||||
.bucket(bucket_name)
|
||||
.policy(&policy)
|
||||
.send()
|
||||
.await?;
|
||||
let read = user_client.get_bucket_policy().bucket(bucket_name).send().await;
|
||||
let write = user_client
|
||||
.put_bucket_policy()
|
||||
.bucket(bucket_name)
|
||||
.policy(&policy)
|
||||
.send()
|
||||
.await;
|
||||
if may_read {
|
||||
read?;
|
||||
let denied = write.expect_err("GetBucketPolicy must not grant PutBucketPolicy");
|
||||
assert_eq!(denied.as_service_error().and_then(ProvideErrorMetadata::code), Some("AccessDenied"));
|
||||
} else {
|
||||
let denied = read.expect_err("PutBucketPolicy must not grant GetBucketPolicy");
|
||||
assert_eq!(denied.as_service_error().and_then(ProvideErrorMetadata::code), Some("AccessDenied"));
|
||||
write?;
|
||||
}
|
||||
}
|
||||
info!("Test Passed!");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
//! not an EIO-returning half-dead disk.
|
||||
//! - [`DiskFaultHarness::bring_disk_online`] restores the renamed directory.
|
||||
//! If the server recreated a skeleton directory at the original path in the
|
||||
//! meantime, the skeleton is moved aside for cleanup with the test root.
|
||||
//! meantime, the skeleton is discarded first.
|
||||
//! - [`DiskFaultHarness::replace_disk_with_empty`] retires the directory and
|
||||
//! creates a fresh empty one, simulating a fresh-disk replacement that the
|
||||
//! server should detect as unformatted and heal.
|
||||
@@ -37,13 +37,12 @@
|
||||
|
||||
use crate::common::{RustFSTestEnvironment, local_http_client};
|
||||
use http::header::{CONTENT_TYPE, HOST};
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::error::Error;
|
||||
use std::io::ErrorKind;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tracing::info;
|
||||
use uuid::Uuid;
|
||||
@@ -171,15 +170,6 @@ impl DiskFaultHarness {
|
||||
/// Start (or restart after [`Self::kill_server`]) the RustFS server with
|
||||
/// all volume directories and the same address.
|
||||
pub async fn start_server(&mut self) -> ChaosResult<()> {
|
||||
self.start_server_with_readiness(false).await
|
||||
}
|
||||
|
||||
/// Start a process once its node read-readiness probe passes.
|
||||
pub async fn start_server_at_read_quorum(&mut self) -> ChaosResult<()> {
|
||||
self.start_server_with_readiness(true).await
|
||||
}
|
||||
|
||||
async fn start_server_with_readiness(&mut self, read_quorum_only: bool) -> ChaosResult<()> {
|
||||
// The common helper always appends `env.temp_dir` as the final storage
|
||||
// path: point it at the last disk for startup and pass the remaining
|
||||
// disks explicitly, then restore it to the root so Drop cleans up
|
||||
@@ -191,13 +181,7 @@ impl DiskFaultHarness {
|
||||
let arg_refs: Vec<&str> = disk_args.iter().map(String::as_str).collect();
|
||||
let env_refs: Vec<(&str, &str)> = self.extra_env.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
|
||||
|
||||
let result = if read_quorum_only {
|
||||
self.env
|
||||
.start_rustfs_server_with_env_at_read_quorum(arg_refs, &env_refs)
|
||||
.await
|
||||
} else {
|
||||
self.env.start_rustfs_server_with_env(arg_refs, &env_refs).await
|
||||
};
|
||||
let result = self.env.start_rustfs_server_with_env(arg_refs, &env_refs).await;
|
||||
self.env.temp_dir = self.root.to_string_lossy().to_string();
|
||||
result
|
||||
}
|
||||
@@ -228,31 +212,19 @@ impl DiskFaultHarness {
|
||||
}
|
||||
|
||||
/// Restore a disk previously taken offline with [`Self::take_disk_offline`].
|
||||
pub fn bring_disk_online(&mut self, disk_index: usize) -> ChaosResult<()> {
|
||||
pub fn bring_disk_online(&self, disk_index: usize) -> ChaosResult<()> {
|
||||
let disk = &self.disks[disk_index];
|
||||
let offline = self.offline_path(disk_index);
|
||||
if !offline.exists() {
|
||||
return Err(format!("disk {disk_index} is not offline").into());
|
||||
}
|
||||
// A degraded write may recreate the target even while it is being cleared.
|
||||
// Move that tree aside atomically and leave its cleanup to the test root.
|
||||
let mut displaced = 0;
|
||||
loop {
|
||||
match std::fs::rename(&offline, disk) {
|
||||
Ok(()) => break,
|
||||
Err(error)
|
||||
if displaced < 8
|
||||
&& (matches!(error.kind(), ErrorKind::DirectoryNotEmpty | ErrorKind::AlreadyExists)
|
||||
|| (cfg!(windows) && error.kind() == ErrorKind::PermissionDenied && disk.is_dir())) => {}
|
||||
Err(error) => return Err(error.into()),
|
||||
}
|
||||
displaced += 1;
|
||||
let retired = self.root.join(format!("disk{disk_index}.recreated-{}", Uuid::new_v4()));
|
||||
match std::fs::rename(disk, retired) {
|
||||
Err(error) if error.kind() == ErrorKind::NotFound => continue,
|
||||
result => result?,
|
||||
}
|
||||
// The running server may have recreated a skeleton directory at the
|
||||
// original path (e.g. via degraded writes); discard it before
|
||||
// restoring the original data.
|
||||
if disk.exists() {
|
||||
std::fs::remove_dir_all(disk)?;
|
||||
}
|
||||
std::fs::rename(&offline, disk)?;
|
||||
info!("Brought disk {} back online: {:?}", disk_index, disk);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ use aws_smithy_http_client::Builder as SmithyHttpClientBuilder;
|
||||
use http::header::{CONTENT_TYPE, HOST};
|
||||
use reqwest::Client as HttpClient;
|
||||
use reqwest::StatusCode;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use serde_json;
|
||||
use std::fs as stdfs;
|
||||
use std::io::{self, ErrorKind};
|
||||
@@ -49,15 +49,6 @@ use uuid::Uuid;
|
||||
// Common constants for all E2E tests
|
||||
pub const DEFAULT_ACCESS_KEY: &str = "rustfsadmin";
|
||||
pub const DEFAULT_SECRET_KEY: &str = "rustfsadmin";
|
||||
|
||||
fn fixture_access_key(default: &str) -> String {
|
||||
if std::env::var("RUSTFS_CORPUS_RECORD").as_deref() == Ok("1") {
|
||||
"rustfsadmin-ci".to_owned()
|
||||
} else {
|
||||
default.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
pub const ENV_RUSTFS_BUILD_FEATURES: &str = "RUSTFS_BUILD_FEATURES";
|
||||
pub(crate) const FAST_DATA_USAGE_SCANNER_ENV: &[(&str, &str)] =
|
||||
&[("RUSTFS_SCANNER_CYCLE", "1"), ("RUSTFS_SCANNER_START_DELAY_SECS", "0")];
|
||||
@@ -641,7 +632,7 @@ impl RustFSTestEnvironment {
|
||||
temp_dir,
|
||||
address,
|
||||
url,
|
||||
access_key: fixture_access_key(DEFAULT_ACCESS_KEY),
|
||||
access_key: DEFAULT_ACCESS_KEY.to_string(),
|
||||
secret_key: DEFAULT_SECRET_KEY.to_string(),
|
||||
process: None,
|
||||
capture_log_path,
|
||||
@@ -660,7 +651,7 @@ impl RustFSTestEnvironment {
|
||||
temp_dir,
|
||||
address: address.to_string(),
|
||||
url,
|
||||
access_key: fixture_access_key(DEFAULT_ACCESS_KEY),
|
||||
access_key: DEFAULT_ACCESS_KEY.to_string(),
|
||||
secret_key: DEFAULT_SECRET_KEY.to_string(),
|
||||
process: None,
|
||||
capture_log_path,
|
||||
@@ -731,7 +722,7 @@ impl RustFSTestEnvironment {
|
||||
cleanup_existing: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
let binary_path = rustfs_binary_path();
|
||||
self.start_rustfs_server_inner_with_binary(&binary_path, extra_args, extra_env, cleanup_existing, false)
|
||||
self.start_rustfs_server_inner_with_binary(&binary_path, extra_args, extra_env, cleanup_existing)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -741,7 +732,6 @@ impl RustFSTestEnvironment {
|
||||
extra_args: Vec<&str>,
|
||||
extra_env: &[(&str, &str)],
|
||||
cleanup_existing: bool,
|
||||
read_quorum_only: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
if cleanup_existing {
|
||||
self.cleanup_existing_processes().await?;
|
||||
@@ -766,7 +756,7 @@ impl RustFSTestEnvironment {
|
||||
self.process = Some(process);
|
||||
|
||||
// Wait for server to be ready
|
||||
self.wait_for_server_ready_with_probe(read_quorum_only).await?;
|
||||
self.wait_for_server_ready().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -780,7 +770,7 @@ impl RustFSTestEnvironment {
|
||||
extra_args: Vec<&str>,
|
||||
extra_env: &[(&str, &str)],
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
self.start_rustfs_server_inner_with_binary(binary_path, extra_args, extra_env, true, false)
|
||||
self.start_rustfs_server_inner_with_binary(binary_path, extra_args, extra_env, true)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -792,7 +782,7 @@ impl RustFSTestEnvironment {
|
||||
extra_args: Vec<&str>,
|
||||
extra_env: &[(&str, &str)],
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
self.start_rustfs_server_inner_with_binary(binary_path, extra_args, extra_env, false, false)
|
||||
self.start_rustfs_server_inner_with_binary(binary_path, extra_args, extra_env, false)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -810,18 +800,6 @@ impl RustFSTestEnvironment {
|
||||
self.start_rustfs_server_inner(extra_args, extra_env, true).await
|
||||
}
|
||||
|
||||
/// Start a degraded read-serving process using the node readiness probe.
|
||||
/// ListBuckets retains its namespace write-quorum requirement.
|
||||
pub async fn start_rustfs_server_with_env_at_read_quorum(
|
||||
&mut self,
|
||||
extra_args: Vec<&str>,
|
||||
extra_env: &[(&str, &str)],
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
let binary_path = rustfs_binary_path();
|
||||
self.start_rustfs_server_inner_with_binary(&binary_path, extra_args, extra_env, true, true)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Start RustFS server without cleaning up other running RustFS processes.
|
||||
///
|
||||
/// This is useful for tests that need multiple independent RustFS instances
|
||||
@@ -850,16 +828,8 @@ impl RustFSTestEnvironment {
|
||||
/// Fails immediately if the spawned server process has already exited
|
||||
/// (e.g. a port bind failure) instead of polling out the full timeout.
|
||||
pub async fn wait_for_server_ready(&mut self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
self.wait_for_server_ready_with_probe(false).await
|
||||
}
|
||||
|
||||
async fn wait_for_server_ready_with_probe(
|
||||
&mut self,
|
||||
read_quorum_only: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
info!("Waiting for RustFS server to be ready on {}", self.address);
|
||||
let client = self.create_s3_client();
|
||||
let health_client = HttpClient::builder().no_proxy().timeout(Duration::from_secs(2)).build()?;
|
||||
|
||||
for i in 0..60 {
|
||||
if let Some(process) = self.process.as_mut()
|
||||
@@ -868,16 +838,7 @@ impl RustFSTestEnvironment {
|
||||
return Err(format!("RustFS server process exited before becoming ready: {status}").into());
|
||||
}
|
||||
|
||||
let ready = if read_quorum_only {
|
||||
health_client
|
||||
.get(format!("{}/minio/health/ready", self.url))
|
||||
.send()
|
||||
.await
|
||||
.is_ok_and(|response| response.status().is_success())
|
||||
} else {
|
||||
TcpStream::connect(&self.address).await.is_ok() && client.list_buckets().send().await.is_ok()
|
||||
};
|
||||
if ready {
|
||||
if TcpStream::connect(&self.address).await.is_ok() && client.list_buckets().send().await.is_ok() {
|
||||
info!("✅ RustFS server is ready after {} attempts", i + 1);
|
||||
return Ok(());
|
||||
}
|
||||
@@ -1044,7 +1005,8 @@ pub async fn execute_awscurl(
|
||||
|
||||
/// `POST` with SigV4 `--service sts` and explicit `Content-Type: application/x-www-form-urlencoded`.
|
||||
///
|
||||
/// RustFS uses this content type to recognize an STS query on `POST /`.
|
||||
/// RustFS `AssumeRole` is handled on `POST /` by the admin router; `is_match` requires this
|
||||
/// content type so s3s routes to the custom handler instead of `Unknown operation`.
|
||||
pub async fn awscurl_post_sts_form_urlencoded(
|
||||
url: &str,
|
||||
body: &str,
|
||||
@@ -1421,7 +1383,7 @@ impl RustFSTestClusterEnvironment {
|
||||
Ok(Self {
|
||||
nodes,
|
||||
temp_dir,
|
||||
access_key: fixture_access_key("rustfs-cluster-test-access"),
|
||||
access_key: "rustfs-cluster-test-access".to_string(),
|
||||
secret_key: "rustfs-cluster-test-secret".to_string(),
|
||||
extra_env,
|
||||
node_extra_env: vec![Vec::new(); topology.node_count],
|
||||
@@ -2542,7 +2504,7 @@ mod tests {
|
||||
RustFSTestClusterEnvironment {
|
||||
nodes,
|
||||
temp_dir,
|
||||
access_key: fixture_access_key(DEFAULT_ACCESS_KEY),
|
||||
access_key: DEFAULT_ACCESS_KEY.to_string(),
|
||||
secret_key: DEFAULT_SECRET_KEY.to_string(),
|
||||
extra_env: Vec::new(),
|
||||
node_extra_env: vec![Vec::new(); topology.node_count],
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
|
||||
//! Over-the-wire smoke net for the embedded console listener (backlog#1154
|
||||
//! peri-4). The console is a second HTTP listener for the control-plane and
|
||||
//! unauthenticated console routes under `/rustfs/console`;
|
||||
//! peri-4). The console is a second HTTP listener that serves the full S3/admin
|
||||
//! surface plus the unauthenticated console routes under `/rustfs/console`;
|
||||
//! before this test its behaviour was only covered by in-process router tests
|
||||
//! (`rustfs/src/admin/console.rs`), so a misconfiguration that exposed
|
||||
//! credentials through the public console endpoints or fail-opened the
|
||||
@@ -26,13 +26,13 @@
|
||||
//! * `/rustfs/console/license` exposes only the coarse `licensed` flag.
|
||||
//! * the console SPA prefix dispatches to the static handler, never to the
|
||||
//! S3 API (no S3 error XML), whether or not console assets are embedded.
|
||||
//! * unauthenticated admin API requests are denied with 403 AccessDenied.
|
||||
//! * S3 root/object requests on the console listener return an empty 404,
|
||||
//! including authenticated requests, before S3 dispatch.
|
||||
//! * unauthenticated requests to the admin API and the S3 root on the console
|
||||
//! listener are denied (403 AccessDenied) — the extra listener does not
|
||||
//! fail-open the protected surface.
|
||||
//! * a listener with the console disabled (the main S3 port here) does not
|
||||
//! serve the unauthenticated console endpoints at all.
|
||||
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, local_http_client, signed_request_with_client};
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, local_http_client};
|
||||
use std::error::Error;
|
||||
use tokio::time::{Duration, sleep};
|
||||
|
||||
@@ -166,39 +166,13 @@ async fn test_console_over_the_wire_smoke() -> TestResult {
|
||||
let admin_body = admin_response.text().await?;
|
||||
assert!(admin_body.contains("AccessDenied"), "admin denial must be AccessDenied: {admin_body}");
|
||||
|
||||
let signed_data_root = signed_request_with_client(
|
||||
&client,
|
||||
http::Method::GET,
|
||||
&format!("{}/", env.url),
|
||||
&env.access_key,
|
||||
&env.secret_key,
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
let s3_root_response = client.get(format!("{console_base}/")).send().await?;
|
||||
assert_eq!(
|
||||
signed_data_root.status(),
|
||||
reqwest::StatusCode::OK,
|
||||
"the same credentials must reach S3 on the data listener"
|
||||
s3_root_response.status(),
|
||||
reqwest::StatusCode::FORBIDDEN,
|
||||
"unauthenticated S3 root on the console listener must be denied"
|
||||
);
|
||||
|
||||
for path in ["/", "/console-object-bucket/key"] {
|
||||
let url = format!("{console_base}{path}");
|
||||
for signed in [false, true] {
|
||||
let response = if signed {
|
||||
signed_request_with_client(&client, http::Method::GET, &url, &env.access_key, &env.secret_key, None, None).await?
|
||||
} else {
|
||||
client.get(&url).send().await?
|
||||
};
|
||||
assert_eq!(
|
||||
response.status(),
|
||||
reqwest::StatusCode::NOT_FOUND,
|
||||
"S3 route {path}, signed={signed} must be isolated from the console listener"
|
||||
);
|
||||
assert!(response.bytes().await?.is_empty(), "isolated S3 routes must not reach a handler");
|
||||
}
|
||||
}
|
||||
|
||||
// --- console disabled on a listener means no console surface at all ------
|
||||
// The main S3 listener of this same process runs with the console disabled,
|
||||
// so its console paths must not answer with the unauthenticated console
|
||||
|
||||
@@ -366,13 +366,13 @@ mod tests {
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": ["s3:PutObject", "s3:PutObjectTagging"],
|
||||
"Action": ["s3:PutObject"],
|
||||
"Resource": [format!("arn:aws:s3:::{destination_bucket}/*")]
|
||||
},
|
||||
{
|
||||
"Effect": "Deny",
|
||||
"Principal": "*",
|
||||
"Action": ["s3:PutObject", "s3:PutObjectTagging"],
|
||||
"Action": ["s3:PutObject"],
|
||||
"Resource": [format!("arn:aws:s3:::{destination_bucket}/*")],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
|
||||
@@ -21,17 +21,32 @@
|
||||
//! when it fails to parse (`amztime.ParseHeader` error is swallowed), so the copy
|
||||
//! proceeds.
|
||||
//!
|
||||
//! The RustFS gateway profile rejects unreadable conditional dates before the copy handler runs.
|
||||
//! The signed requests below pin both the successful copy and the HTTP 400 `InvalidArgument` response.
|
||||
//! RustFS routes S3 through the `s3s` crate, which models the copy-source
|
||||
//! conditional-date headers as typed `Timestamp` fields and rejects an
|
||||
//! unparsable value with `400 InvalidArgument` during request deserialization —
|
||||
//! this happens *after* SigV4 verification but *before* the RustFS `CopyObject`
|
||||
//! handler runs. Because the header is part of the client's `SignedHeaders`, the
|
||||
//! value cannot be stripped or rewritten by a pre-`s3s` layer without breaking the
|
||||
//! signature, and `s3s` exposes no hook between auth and typed deserialization.
|
||||
//! Matching MinIO's tolerant behavior therefore requires a change in `s3s`
|
||||
//! (lenient parsing of conditional-date headers). See the PR description for
|
||||
//! details.
|
||||
//!
|
||||
//! This test pins the two ends of the current behavior:
|
||||
//! * a *valid* HTTP-date copy-source conditional header is accepted and the copy
|
||||
//! succeeds (the common, real-SDK path), and
|
||||
//! * an *invalid* date value is rejected with `400 InvalidArgument` at the `s3s`
|
||||
//! layer (the documented gap). When `s3s` gains lenient parsing, the second
|
||||
//! assertion should be flipped to expect a successful copy.
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, local_http_client};
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
use http::header::HOST;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use std::error::Error;
|
||||
|
||||
/// Signed raw `PUT` copy request with an explicit copy-source conditional
|
||||
@@ -86,7 +101,7 @@ mod tests {
|
||||
|
||||
let copy_source = format!("/{bucket}/src.txt");
|
||||
|
||||
// A valid future HTTP-date allows the copy.
|
||||
// A valid future HTTP-date is accepted by s3s and the copy succeeds.
|
||||
let (status, body) = signed_copy(
|
||||
&env.url,
|
||||
&format!("/{bucket}/dst-valid.txt"),
|
||||
@@ -99,7 +114,10 @@ mod tests {
|
||||
assert_eq!(status, reqwest::StatusCode::OK, "valid copy-source date must succeed: {body}");
|
||||
assert!(body.contains("CopyObjectResult"), "expected CopyObjectResult XML: {body}");
|
||||
|
||||
// The signed header reaches the RustFS profile's conditional-date check unchanged.
|
||||
// An unparsable date ("Invalid Date") is currently rejected by s3s at the
|
||||
// deserialization layer with 400 InvalidArgument. This documents the s3s
|
||||
// limitation described in backlog#618 item 8. When s3s parses these headers
|
||||
// leniently (matching MinIO), this should become a successful copy.
|
||||
let (status, body) = signed_copy(
|
||||
&env.url,
|
||||
&format!("/{bucket}/dst-invalid.txt"),
|
||||
@@ -112,7 +130,7 @@ mod tests {
|
||||
assert_eq!(
|
||||
status,
|
||||
reqwest::StatusCode::BAD_REQUEST,
|
||||
"expected the signed invalid date to be rejected (backlog#618): {body}"
|
||||
"invalid copy-source date currently rejected by s3s (backlog#618): {body}"
|
||||
);
|
||||
assert!(body.contains("InvalidArgument"), "expected InvalidArgument for invalid date: {body}");
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ mod tests {
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
use aws_sdk_s3::types::{BucketVersioningStatus, VersioningConfiguration};
|
||||
use http::header::HOST;
|
||||
use rustfs_s3_types::Body;
|
||||
use rustfs_signer::constants::UNSIGNED_PAYLOAD;
|
||||
use rustfs_signer::sign_v4;
|
||||
use s3s::Body;
|
||||
use std::error::Error;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::net::TcpStream;
|
||||
|
||||
@@ -36,7 +36,6 @@ mod replication_delete_marker_test;
|
||||
mod replication_quota_test;
|
||||
mod s3_basic_test;
|
||||
mod s3_during_data_movement_test;
|
||||
mod scanner_cluster_observation_test;
|
||||
mod scanner_heal_topology_fixture;
|
||||
mod scanner_heal_topology_test;
|
||||
mod scanner_heal_topology_tier_test;
|
||||
|
||||
@@ -26,7 +26,7 @@ use aws_sdk_s3::types::{
|
||||
DefaultRetention, ObjectLockConfiguration, ObjectLockEnabled, ObjectLockLegalHoldStatus, ObjectLockRetentionMode,
|
||||
ObjectLockRule,
|
||||
};
|
||||
use jiff::{SignedDuration, Timestamp};
|
||||
use chrono::{Duration as ChronoDuration, Utc};
|
||||
|
||||
fn delete_denied(error: &SdkError<DeleteObjectError>, context: &str) -> TestResult {
|
||||
let code = error.as_service_error().and_then(ProvideErrorMetadata::code);
|
||||
@@ -66,7 +66,7 @@ async fn four_node_four_drive_object_lock_worm_blocks_delete() -> TestResult {
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
let retain_until = Timestamp::now() + SignedDuration::from_hours(24);
|
||||
let retain_until = Utc::now() + ChronoDuration::days(1);
|
||||
|
||||
let compliance_key = "compliance.bin";
|
||||
let compliance_version = put_object_with_retention(
|
||||
@@ -176,10 +176,7 @@ async fn four_node_default_retention_is_visible_and_non_lock_bucket_rejects_conf
|
||||
let retain_until = retention
|
||||
.retain_until_date()
|
||||
.ok_or("default retention omitted retain-until date")?;
|
||||
assert!(
|
||||
retain_until.secs() > Timestamp::now().as_second(),
|
||||
"default retention is not in the future"
|
||||
);
|
||||
assert!(retain_until.secs() > Utc::now().timestamp(), "default retention is not in the future");
|
||||
|
||||
let versioning = reader.get_bucket_versioning().bucket(&bucket).send().await?;
|
||||
assert_eq!(versioning.status().map(|status| status.as_str()), Some("Enabled"));
|
||||
|
||||
@@ -159,7 +159,6 @@ async fn four_node_health_inventory_metrics_and_audit_delivery_are_consistent()
|
||||
|
||||
let info_body = cluster_admin_ok(&dist.cluster, Method::GET, "/rustfs/admin/v3/info", None).await?;
|
||||
let info: Value = serde_json::from_str(&info_body)?;
|
||||
assert!(info.get("inventory").is_none(), "inventory requires explicit opt-in");
|
||||
let servers = info["info"]["servers"]
|
||||
.as_array()
|
||||
.ok_or_else(|| format!("admin info omitted servers: {info}"))?;
|
||||
@@ -201,24 +200,6 @@ async fn four_node_health_inventory_metrics_and_audit_delivery_are_consistent()
|
||||
assert!(sample.finally, "node {node_idx} metrics sample was not terminal");
|
||||
assert!(sample.errors.is_empty(), "node {node_idx} metrics reported errors: {:?}", sample.errors);
|
||||
assert!(!sample.hosts.is_empty(), "node {node_idx} metrics omitted hosts");
|
||||
assert!(sample.scanner_node.is_none(), "default metrics must not expose the internal peer sample");
|
||||
wait_until(
|
||||
Duration::from_secs(30),
|
||||
|| async {
|
||||
let frame: Value = serde_json::from_str(
|
||||
&node_admin_body(&dist, node_idx, "/rustfs/admin/v3/realtime?scope=cluster&types=1&n=1").await?,
|
||||
)?;
|
||||
assert_eq!(frame["final"], true);
|
||||
let summary = &frame["cluster_scanner"];
|
||||
assert_eq!(summary["nodes_total"], 4, "known cluster membership");
|
||||
assert!(summary["sampled_at"].as_str().is_some());
|
||||
assert!(matches!(summary["state"].as_str(), Some("scanning" | "idle" | "unknown")));
|
||||
assert_eq!(summary["current"].is_object(), summary["state"] == "scanning");
|
||||
Ok(summary["nodes_responded"] == 4)
|
||||
},
|
||||
"every request node reaches the full scanner peer set",
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let targets_body = cluster_admin_ok(&dist.cluster, Method::GET, "/rustfs/admin/v3/audit/target/list", None).await?;
|
||||
@@ -253,38 +234,6 @@ async fn four_node_health_inventory_metrics_and_audit_delivery_are_consistent()
|
||||
"audit entry leaked the root secret key"
|
||||
);
|
||||
|
||||
let pending = unique_bucket("inventory");
|
||||
dist.create_bucket(&pending).await?;
|
||||
let listed = dist.client(1)?.list_buckets().send().await?;
|
||||
assert_eq!(listed.buckets().len(), 2, "expected the two test buckets");
|
||||
wait_until(
|
||||
Duration::from_secs(30),
|
||||
|| async {
|
||||
let body = node_admin_body(&dist, 1, "/rustfs/admin/v3/info?include=inventory").await?;
|
||||
let response: Value = serde_json::from_str(&body)?;
|
||||
let inventory: rustfs_madmin::ClusterInventory = serde_json::from_value(response["inventory"].clone())?;
|
||||
if inventory.current_buckets != Some(2) {
|
||||
return Ok(false);
|
||||
}
|
||||
match inventory.measured_buckets {
|
||||
None | Some(0) => {
|
||||
assert_eq!(inventory.measured_objects, None);
|
||||
assert_eq!(inventory.measured_bytes, None);
|
||||
}
|
||||
Some(1 | 2) => {
|
||||
assert!(inventory.measured_objects.is_some_and(|objects| objects <= 1));
|
||||
}
|
||||
Some(count) => panic!("measured {count} buckets across a two-bucket namespace"),
|
||||
}
|
||||
if inventory.measured_buckets != Some(2) {
|
||||
assert_ne!(inventory.converged, Some(true));
|
||||
}
|
||||
Ok(true)
|
||||
},
|
||||
"inventory reflects the current namespace and reports scanner coverage independently",
|
||||
)
|
||||
.await?;
|
||||
|
||||
let result = verify_write_observations_during_peer_failure(&dist, &bucket).await;
|
||||
collector.abort();
|
||||
result
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
// Copyright 2026 RustFS Team
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use super::harness::{NODE_COUNT, TestResult, wait_until};
|
||||
use super::scanner_peer_bucket_fixture::PeerBucketRun;
|
||||
use crate::common::init_logging;
|
||||
use futures::future::try_join_all;
|
||||
use serde_json::Value;
|
||||
use std::time::Duration;
|
||||
use time::OffsetDateTime;
|
||||
use time::format_description::well_known::Rfc3339;
|
||||
|
||||
const CLUSTER_SCANNER: &str = "/rustfs/admin/v3/realtime?n=1&types=1&scope=cluster";
|
||||
const OBSERVATION_TIMEOUT: Duration = Duration::from_secs(35);
|
||||
|
||||
async fn scanner_frames(run: &PeerBucketRun) -> TestResult<Vec<Value>> {
|
||||
try_join_all((0..NODE_COUNT).map(|node| run.admin_json(node, CLUSTER_SCANNER))).await
|
||||
}
|
||||
|
||||
fn full_sample(frame: &Value) -> bool {
|
||||
frame["final"] == true
|
||||
&& frame["cluster_scanner"]["nodes_total"] == NODE_COUNT
|
||||
&& frame["cluster_scanner"]["nodes_responded"] == NODE_COUNT
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn followers_report_the_coordinators_active_progress_and_committed_completion() -> TestResult {
|
||||
init_logging();
|
||||
let mut run = PeerBucketRun::start("cluster-scanner-observation").await?;
|
||||
let baseline = run.quiet_baseline().await?;
|
||||
let leader = run.leader().await?;
|
||||
let pid = run.pid(leader)?;
|
||||
let hot = run.buckets[2].clone();
|
||||
run.barrier.arm("before_start_snapshot", pid, None)?;
|
||||
run.barrier.start_session(&run.buckets)?;
|
||||
// All four child processes and the harness use the same host clock.
|
||||
let written_after = OffsetDateTime::now_utc();
|
||||
run.put(leader, &hot, "wake-cluster-observation", 149).await?;
|
||||
|
||||
let start = run.barrier.wait_stage("before_start_snapshot", pid, None, true).await?;
|
||||
let epoch = start["detail"]["epoch"].as_u64().ok_or("start gate omitted epoch")?;
|
||||
let cycle = start["detail"]["cycle"].as_u64().ok_or("start gate omitted cycle")?;
|
||||
if baseline.scanner_epoch != Some(epoch) || baseline.scanner_cycle.is_none_or(|previous| previous >= cycle) {
|
||||
return Err("controlled cycle did not follow the quiet baseline under the same coordinator".into());
|
||||
}
|
||||
run.barrier.arm("root_durable", pid, Some((epoch, cycle)))?;
|
||||
run.barrier.release("before_start_snapshot", pid)?;
|
||||
run.barrier
|
||||
.wait_stage("root_durable", pid, Some((epoch, cycle)), true)
|
||||
.await?;
|
||||
|
||||
// The leader is held after the real walk and before committing its cycle completion.
|
||||
// Each ingress node maintains its own short-lived cluster sample cache.
|
||||
let expected_leader = &run.dist.cluster.nodes[leader].url;
|
||||
let active = wait_until(
|
||||
OBSERVATION_TIMEOUT,
|
||||
|| async {
|
||||
let frames = scanner_frames(&run).await?;
|
||||
let started = frames[leader]["cluster_scanner"]["current"]["started_at"].as_str();
|
||||
let consistent = started.is_some()
|
||||
&& frames.iter().all(|frame| {
|
||||
let summary = &frame["cluster_scanner"];
|
||||
let current = &summary["current"];
|
||||
full_sample(frame)
|
||||
&& summary["state"] == "scanning"
|
||||
&& current["cycle"] == cycle
|
||||
&& current["leader"].as_str() == Some(expected_leader.as_str())
|
||||
&& current["started_at"].as_str() == started
|
||||
&& current["objects_scanned"].as_u64().is_some_and(|objects| objects > 0)
|
||||
});
|
||||
if !consistent {
|
||||
tracing::info!(
|
||||
?frames,
|
||||
cycle,
|
||||
expected_leader,
|
||||
"waiting for active scanner progress on every ingress node"
|
||||
);
|
||||
}
|
||||
Ok(consistent)
|
||||
},
|
||||
"leader and all three followers report the identified active cycle with nonzero work",
|
||||
)
|
||||
.await;
|
||||
run.barrier.disarm()?;
|
||||
run.barrier.release("root_durable", pid)?;
|
||||
active?;
|
||||
|
||||
wait_until(
|
||||
OBSERVATION_TIMEOUT,
|
||||
|| async {
|
||||
let frames = scanner_frames(&run).await?;
|
||||
let settled = frames.iter().all(|frame| {
|
||||
let summary = &frame["cluster_scanner"];
|
||||
full_sample(frame)
|
||||
&& summary["state"] == "idle"
|
||||
&& summary.get("current").is_none()
|
||||
&& summary["last_attempt"]["cycle"] == cycle
|
||||
&& summary["last_attempt"]["result"] == "success"
|
||||
&& summary["last_success_at"].as_str().is_some_and(|value| {
|
||||
OffsetDateTime::parse(value, &Rfc3339).is_ok_and(|completed| completed >= written_after)
|
||||
})
|
||||
});
|
||||
if !settled {
|
||||
tracing::info!(?frames, cycle, "waiting for the controlled scanner cycle to finish");
|
||||
}
|
||||
Ok(settled)
|
||||
},
|
||||
"every ingress node reports the completed cycle and an idle cluster scanner",
|
||||
)
|
||||
.await
|
||||
}
|
||||
@@ -38,8 +38,8 @@ use aws_sdk_s3::types::{
|
||||
BucketVersioningStatus, CompletedMultipartUpload, CompletedPart, ObjectLockLegalHoldStatus, ObjectLockRetentionMode,
|
||||
VersioningConfiguration,
|
||||
};
|
||||
use chrono::{DateTime, Utc};
|
||||
use http::{Method, StatusCode};
|
||||
use jiff::Timestamp;
|
||||
use serde_json::Value;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -526,8 +526,8 @@ async fn put_multipart(client: &Client, bucket: &str, key: &str) -> TestResult<V
|
||||
Ok(body)
|
||||
}
|
||||
|
||||
fn retention_deadline() -> TestResult<Timestamp> {
|
||||
Ok(Timestamp::now() + jiff::SignedDuration::from_hours(24))
|
||||
fn retention_deadline() -> TestResult<DateTime<Utc>> {
|
||||
DateTime::<Utc>::from_timestamp(Utc::now().timestamp() + 24 * 3600, 0).ok_or_else(|| "retention deadline out of range".into())
|
||||
}
|
||||
|
||||
/// Seed the deterministic inventory into the seed pool and record it.
|
||||
@@ -654,7 +654,7 @@ pub(crate) async fn seed_manifest(run: &TopologyRun) -> TestResult<TopologyManif
|
||||
let mut entry = ManifestEntry::body(&locked, &key, "compliance", Some(version_id.clone()), Some(version_id), &body);
|
||||
entry.retention = Some(RetentionRecord {
|
||||
mode: "COMPLIANCE".to_string(),
|
||||
retain_until_unix: retain_until.as_second(),
|
||||
retain_until_unix: retain_until.timestamp(),
|
||||
});
|
||||
entries.push(entry);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ use super::harness::{
|
||||
use crate::common::{
|
||||
AdminTransport, admin_add_canned_policy_via, admin_attach_user_policy_via, admin_create_user_via, init_logging,
|
||||
};
|
||||
use crate::upgrade_compatibility_test::{UpgradeSourceCapabilities, wait_for_upgrade_write_readiness};
|
||||
use crate::upgrade_compatibility_test::wait_for_upgrade_write_readiness;
|
||||
use aws_sdk_s3::Client;
|
||||
use aws_sdk_s3::error::ProvideErrorMetadata;
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -427,12 +427,7 @@ async fn assert_history_and_iam(dist: &DistCluster, seed: &UpgradeSeed, context:
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn compare_degraded_legacy_list_parts(
|
||||
dist: &mut DistCluster,
|
||||
seed: &UpgradeSeed,
|
||||
previous: &Path,
|
||||
source: &UpgradeSourceCapabilities,
|
||||
) -> TestResult {
|
||||
async fn compare_degraded_legacy_list_parts(dist: &mut DistCluster, seed: &UpgradeSeed, previous: &Path) -> TestResult {
|
||||
let decoded = String::from_utf8(base64_simd::URL_SAFE_NO_PAD.decode_to_vec(seed.multipart_upload.as_bytes())?)?;
|
||||
let (_, upload_dir) = decoded.split_once('.').ok_or("legacy upload ID lacks deployment delimiter")?;
|
||||
let hash = sha256_hex(format!("{}/legacy-multipart.bin", seed.history_bucket).as_bytes());
|
||||
@@ -494,22 +489,16 @@ async fn compare_degraded_legacy_list_parts(
|
||||
// Three online disks retain metadata quorum but have no part directory;
|
||||
// the fourth disk is offline. A legacy empty response is not a proof that
|
||||
// the unavailable participant has no part.
|
||||
let mut quorum_errors =
|
||||
vec![current.expect_err("current coordinator must not infer empty from missing directories and offline disks")];
|
||||
if source.requires_list_parts_read_quorum {
|
||||
quorum_errors.push(legacy.expect_err("previous coordinator must require evidence from unavailable disks"));
|
||||
} else {
|
||||
assert!(
|
||||
legacy
|
||||
.expect("previous coordinator should expose its legacy empty-list behavior")
|
||||
.parts()
|
||||
.is_empty()
|
||||
);
|
||||
}
|
||||
for error in quorum_errors {
|
||||
assert_eq!(error.raw_response().expect("S3 response").status().as_u16(), 503);
|
||||
assert_eq!(error.as_service_error().and_then(|error| error.meta().code()), Some("ServiceUnavailable"));
|
||||
}
|
||||
let legacy = legacy.expect("previous coordinator should expose its legacy empty-list behavior");
|
||||
assert!(legacy.parts().is_empty());
|
||||
let current = current.expect_err("current coordinator must not infer empty from missing directories and offline disks");
|
||||
assert_eq!(current.raw_response().expect("current S3 response").status().as_u16(), 503);
|
||||
// Since #9149, SlowDownRead is reserved for GET/HEAD object reads; a
|
||||
// ListParts read-quorum failure is reported as ServiceUnavailable.
|
||||
assert_eq!(
|
||||
current.as_service_error().and_then(|error| error.meta().code()),
|
||||
Some("ServiceUnavailable")
|
||||
);
|
||||
dist.cluster.start_node_from_binary(3, previous).await?;
|
||||
wait_for_upgrade_write_readiness(&clients, &seed.history_bucket, "mixed-list-restored", CREDENTIAL_TIMEOUT).await?;
|
||||
for (path, before) in original_files {
|
||||
@@ -531,7 +520,7 @@ async fn compare_degraded_legacy_list_parts(
|
||||
assert_eq!(listed.parts()[0].e_tag(), Some(seed.multipart_etag.as_str()));
|
||||
}
|
||||
eprintln!(
|
||||
"MPU mixed degraded: one offline disk, three missing part directories; checked each coordinator against its release contract; original part restored on both"
|
||||
"MPU mixed degraded: one offline disk, three missing part directories; previous returned empty, current returned 503 SlowDownRead; original part restored on both"
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
@@ -603,7 +592,6 @@ async fn replace_node_and_wait_for_write_readiness(dist: &mut DistCluster, seed:
|
||||
async fn four_node_rolling_upgrade_preserves_history_and_iam_credentials() -> TestResult {
|
||||
init_logging();
|
||||
let previous = source_binary()?;
|
||||
let source = UpgradeSourceCapabilities::from_binary(&previous).await?;
|
||||
let mut dist = DistCluster::new_stopped(DistLayout::FourNodeFourDisk).await?;
|
||||
dist.cluster.set_env("RUSTFS_STORAGE_CLASS_RRS", "EC:0");
|
||||
capture_upgrade_logs(&mut dist, "rolling-upgrade")?;
|
||||
@@ -613,7 +601,7 @@ async fn four_node_rolling_upgrade_preserves_history_and_iam_credentials() -> Te
|
||||
|
||||
replace_node_and_wait_for_write_readiness(&mut dist, &seed, 0).await?;
|
||||
assert_history_and_iam(&dist, &seed, "one-current-node").await?;
|
||||
compare_degraded_legacy_list_parts(&mut dist, &seed, &previous, &source).await?;
|
||||
compare_degraded_legacy_list_parts(&mut dist, &seed, &previous).await?;
|
||||
|
||||
for node_idx in [1, 2] {
|
||||
replace_node_and_wait_for_write_readiness(&mut dist, &seed, node_idx).await?;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
//! corpus, not here. The comparator is pure so it can be tested without a server.
|
||||
|
||||
use serde::Serialize;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
@@ -70,9 +69,6 @@ pub(crate) struct Observation {
|
||||
pub error_code: Option<String>,
|
||||
/// Allowlisted headers only, lowercase names, normalized values.
|
||||
pub headers: BTreeMap<String, String>,
|
||||
/// Captured before SDK response interceptors can rewrite the response.
|
||||
#[serde(skip)]
|
||||
pub(super) wire_head: Option<WireHead>,
|
||||
/// Typed values decoded from the response body, never free text.
|
||||
pub fields: BTreeMap<String, String>,
|
||||
/// Diagnostic only; never compared.
|
||||
@@ -91,10 +87,10 @@ impl Observation {
|
||||
) -> Self {
|
||||
let headers = headers
|
||||
.into_iter()
|
||||
.filter_map(|(name, value)| {
|
||||
let name = compared_header(name)?;
|
||||
.filter_map(|(name, value)| compared_header(name).map(|name| (name, value)))
|
||||
.map(|(name, value)| {
|
||||
let value = normalized_header_value(&name, value);
|
||||
Some((name, value))
|
||||
(name, value)
|
||||
})
|
||||
.collect();
|
||||
Self {
|
||||
@@ -103,7 +99,6 @@ impl Observation {
|
||||
status,
|
||||
error_code,
|
||||
headers,
|
||||
wire_head: None,
|
||||
fields: BTreeMap::new(),
|
||||
message: None,
|
||||
}
|
||||
@@ -129,106 +124,6 @@ pub(crate) struct Difference {
|
||||
pub b: String,
|
||||
}
|
||||
|
||||
/// Whether side A is the same binary under test or a pinned released reference binary.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) enum ComparisonMode {
|
||||
SameBinary,
|
||||
Reference,
|
||||
}
|
||||
|
||||
/// A maintainer-signed behavior change between a released reference binary (side A) and the
|
||||
/// current candidate binary (side B).
|
||||
///
|
||||
/// Exemptions apply only in [`ComparisonMode::Reference`] and must match the exact
|
||||
/// `(op, case, field, a, b)` tuple with no other unruled difference on the same `(op, case)`.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct AcceptedChange {
|
||||
pub op: &'static str,
|
||||
pub case: &'static str,
|
||||
pub field: &'static str,
|
||||
pub reference_value: &'static str,
|
||||
pub candidate_value: &'static str,
|
||||
pub ruling: &'static str,
|
||||
}
|
||||
|
||||
impl AcceptedChange {
|
||||
pub(crate) fn matches(&self, diff: &Difference) -> bool {
|
||||
diff.op == self.op
|
||||
&& diff.case == self.case
|
||||
&& diff.field == self.field
|
||||
&& diff.a == self.reference_value
|
||||
&& diff.b == self.candidate_value
|
||||
}
|
||||
}
|
||||
|
||||
/// Maintainer-signed accepted differences for external reference-binary parity runs.
|
||||
pub(crate) const ACCEPTED_REFERENCE_CHANGES: &[AcceptedChange] = &[
|
||||
// Signed off in rustfs/backlog#2684#issuecomment-7163283798:
|
||||
// Commit 8f81762a6 aligned PutBucketPolicy on malformed JSON with AWS S3 (`400 MalformedPolicy`)
|
||||
// instead of official 1.0.5's `400 InvalidArgument`.
|
||||
AcceptedChange {
|
||||
op: "PutBucketPolicy",
|
||||
case: "negative",
|
||||
field: "error_code",
|
||||
reference_value: "InvalidArgument",
|
||||
candidate_value: "MalformedPolicy",
|
||||
ruling: "rustfs/backlog#2684#issuecomment-7163283798 (commit 8f81762a6)",
|
||||
},
|
||||
];
|
||||
|
||||
/// One difference explicitly exempted by an [`AcceptedChange`] ruling in reference mode.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
|
||||
pub(crate) struct AcceptedDifference {
|
||||
#[serde(flatten)]
|
||||
pub difference: Difference,
|
||||
pub ruling: String,
|
||||
}
|
||||
|
||||
/// Separates raw differences into unruled failures and maintainer-signed accepted changes.
|
||||
///
|
||||
/// Accepted changes are evaluated only in [`ComparisonMode::Reference`]. In
|
||||
/// [`ComparisonMode::SameBinary`], every difference stays unruled even when rules are supplied.
|
||||
/// Evaluation is also atomic per `(op, case)`: if any field of a case has an unruled difference
|
||||
/// (for example, `status` also differs), no field on that case is accepted.
|
||||
pub(crate) fn partition_differences(
|
||||
raw: Vec<Difference>,
|
||||
mode: ComparisonMode,
|
||||
accepted_changes: &[AcceptedChange],
|
||||
) -> (Vec<Difference>, Vec<AcceptedDifference>) {
|
||||
if mode != ComparisonMode::Reference || accepted_changes.is_empty() {
|
||||
return (raw, Vec::new());
|
||||
}
|
||||
let matched: Vec<Option<&AcceptedChange>> = raw
|
||||
.iter()
|
||||
.map(|diff| accepted_changes.iter().find(|rule| rule.matches(diff)))
|
||||
.collect();
|
||||
let unruled_cases: BTreeSet<(&str, &str)> = raw
|
||||
.iter()
|
||||
.zip(&matched)
|
||||
.filter_map(|(diff, rule)| rule.is_none().then_some((diff.op.as_str(), diff.case.as_str())))
|
||||
.collect();
|
||||
let rulings: Vec<Option<&'static str>> = raw
|
||||
.iter()
|
||||
.zip(&matched)
|
||||
.map(|(diff, rule)| {
|
||||
rule.filter(|_| !unruled_cases.contains(&(diff.op.as_str(), diff.case.as_str())))
|
||||
.map(|rule| rule.ruling)
|
||||
})
|
||||
.collect();
|
||||
let mut unruled = Vec::new();
|
||||
let mut accepted = Vec::new();
|
||||
for (diff, ruling) in raw.into_iter().zip(rulings) {
|
||||
match ruling {
|
||||
Some(ruling) => accepted.push(AcceptedDifference {
|
||||
difference: diff,
|
||||
ruling: ruling.to_owned(),
|
||||
}),
|
||||
None => unruled.push(diff),
|
||||
}
|
||||
}
|
||||
(unruled, accepted)
|
||||
}
|
||||
|
||||
/// Every difference between two transcripts of the same script, matched by `(op, case)`.
|
||||
pub(crate) fn compare(a: &[Observation], b: &[Observation]) -> Vec<Difference> {
|
||||
let mut differences = Vec::new();
|
||||
@@ -330,65 +225,6 @@ pub(crate) fn compared_cases(a: &[Observation], b: &[Observation]) -> usize {
|
||||
.count()
|
||||
}
|
||||
|
||||
/// Status and the digest of unique header names at the transport boundary. Header values are never retained.
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub(super) struct WireHead {
|
||||
status: u16,
|
||||
header_names_sha256: String,
|
||||
}
|
||||
|
||||
impl WireHead {
|
||||
pub(super) fn new<'h>(status: u16, names: impl Iterator<Item = &'h str>) -> Self {
|
||||
let names: BTreeSet<_> = names.map(str::to_ascii_lowercase).collect();
|
||||
let mut digest = Sha256::new();
|
||||
for name in names {
|
||||
digest.update(name.as_bytes());
|
||||
digest.update(b"\n");
|
||||
}
|
||||
Self {
|
||||
status,
|
||||
header_names_sha256: hex_simd::encode_to_string(digest.finalize(), hex_simd::AsciiCase::Lower),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Evidence for one transmitted response, including cases where the two sides agreed.
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(super) struct ResponseReceipt {
|
||||
op: &'static str,
|
||||
case: &'static str,
|
||||
#[serde(flatten)]
|
||||
head: WireHead,
|
||||
}
|
||||
|
||||
pub(super) fn response_receipts(observations: &[Observation]) -> Vec<ResponseReceipt> {
|
||||
observations
|
||||
.iter()
|
||||
.filter_map(|o| {
|
||||
Some(ResponseReceipt {
|
||||
op: o.op,
|
||||
case: o.case,
|
||||
head: o.wire_head.clone()?,
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(super) struct PairedReceipts {
|
||||
responses_a: Vec<ResponseReceipt>,
|
||||
responses_b: Vec<ResponseReceipt>,
|
||||
}
|
||||
|
||||
impl PairedReceipts {
|
||||
pub(super) fn new(a: &[Observation], b: &[Observation]) -> Self {
|
||||
Self {
|
||||
responses_a: response_receipts(a),
|
||||
responses_b: response_receipts(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The JSON report written for every run.
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct Report {
|
||||
@@ -407,9 +243,6 @@ pub(crate) struct Report {
|
||||
pub compared_ops: usize,
|
||||
pub compared_cases: usize,
|
||||
pub differences: Vec<Difference>,
|
||||
pub accepted_differences: Vec<AcceptedDifference>,
|
||||
#[serde(flatten)]
|
||||
pub(super) responses: PairedReceipts,
|
||||
}
|
||||
|
||||
impl Report {
|
||||
@@ -432,18 +265,6 @@ pub(crate) fn render(differences: &[Difference]) -> String {
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
/// One line per accepted difference, for run diagnostics.
|
||||
pub(crate) fn render_accepted(differences: &[AcceptedDifference]) -> String {
|
||||
differences
|
||||
.iter()
|
||||
.map(|entry| {
|
||||
let d = &entry.difference;
|
||||
format!("({}, {}, {}, a={:?}, b={:?}, ruling={:?})", d.op, d.case, d.field, d.a, d.b, entry.ruling)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -664,20 +485,6 @@ mod tests {
|
||||
#[test]
|
||||
fn the_report_lists_each_difference_as_op_field_a_b() {
|
||||
let directory = std::env::temp_dir().join(format!("dual-stack-report-{}", uuid::Uuid::new_v4()));
|
||||
let mut a = [Observation::new(
|
||||
"GetBucketLocation",
|
||||
"normal",
|
||||
200,
|
||||
None,
|
||||
[("x-test-only", "private value"), ("Date", "clock a"), ("date", "duplicate")],
|
||||
)
|
||||
.with_field("location_constraint", "us-east-1")];
|
||||
let mut b = [
|
||||
Observation::new("GetBucketLocation", "normal", 200, None, [("DATE", "clock b"), ("X-TEST-ONLY", "other")])
|
||||
.with_field("location_constraint", "eu-west-1"),
|
||||
];
|
||||
a[0].wire_head = Some(WireHead::new(200, ["x-test-only", "Date", "date"].into_iter()));
|
||||
b[0].wire_head = Some(WireHead::new(201, ["Date"].into_iter()));
|
||||
let report = Report {
|
||||
schema: 2,
|
||||
run: "unit".into(),
|
||||
@@ -690,27 +497,15 @@ mod tests {
|
||||
region_b: Some("eu-west-1".into()),
|
||||
compared_ops: 1,
|
||||
compared_cases: 1,
|
||||
differences: compare(&a, &b),
|
||||
accepted_differences: Vec::new(),
|
||||
responses: PairedReceipts::new(&a, &b),
|
||||
differences: compare(
|
||||
&[ok("GetBucketLocation").with_field("location_constraint", "us-east-1")],
|
||||
&[ok("GetBucketLocation").with_field("location_constraint", "eu-west-1")],
|
||||
),
|
||||
};
|
||||
let path = report.write_to(&directory).expect("write the report");
|
||||
let json: serde_json::Value = serde_json::from_slice(&std::fs::read(&path).expect("read the report")).expect("parse");
|
||||
let _ = std::fs::remove_dir_all(&directory);
|
||||
assert_eq!(path.file_name().and_then(|name| name.to_str()), Some("unit.json"));
|
||||
let expected_receipt = serde_json::json!([{
|
||||
"op": "GetBucketLocation", "case": "normal", "status": 200,
|
||||
"header_names_sha256": "fc98ca59b6a14566b52845df9838e7fb48e1e162149d2b6967085ff0a6a20da3",
|
||||
}]);
|
||||
assert_eq!(json["responses_a"], expected_receipt);
|
||||
assert_eq!(
|
||||
json["responses_b"],
|
||||
serde_json::json!([{
|
||||
"op": "GetBucketLocation", "case": "normal", "status": 201,
|
||||
"header_names_sha256": "426e0b848d77d7b3d778187d006056ee406221ca567ce2844ca403dc834ff8f1"
|
||||
}])
|
||||
);
|
||||
assert!(response_receipts(&[ok("HeadBucket")]).is_empty());
|
||||
assert_eq!(json["compared_ops"], 1);
|
||||
assert_eq!(json["reference_side"], "a");
|
||||
assert_eq!(json["version_a"], "rustfs 1.0.4");
|
||||
@@ -725,203 +520,5 @@ mod tests {
|
||||
"b": "eu-west-1",
|
||||
}])
|
||||
);
|
||||
assert_eq!(json["accepted_differences"], serde_json::json!([]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn accepted_reference_change_exempts_only_exact_put_bucket_policy_tuple() {
|
||||
let a = vec![Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("InvalidArgument".into()),
|
||||
[("content-type", "application/xml")],
|
||||
)];
|
||||
let b = vec![Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("MalformedPolicy".into()),
|
||||
[("content-type", "application/xml")],
|
||||
)];
|
||||
|
||||
let (unruled, accepted) = partition_differences(compare(&a, &b), ComparisonMode::Reference, ACCEPTED_REFERENCE_CHANGES);
|
||||
assert!(unruled.is_empty(), "expected 0 unruled differences, got: {unruled:?}");
|
||||
assert_eq!(
|
||||
accepted,
|
||||
vec![AcceptedDifference {
|
||||
difference: Difference {
|
||||
op: "PutBucketPolicy".into(),
|
||||
case: "negative".into(),
|
||||
field: "error_code".into(),
|
||||
a: "InvalidArgument".into(),
|
||||
b: "MalformedPolicy".into(),
|
||||
},
|
||||
ruling: "rustfs/backlog#2684#issuecomment-7163283798 (commit 8f81762a6)".into(),
|
||||
}]
|
||||
);
|
||||
|
||||
let directory = std::env::temp_dir().join(format!("dual-stack-accepted-report-{}", uuid::Uuid::new_v4()));
|
||||
let report = Report {
|
||||
schema: 2,
|
||||
run: "accepted".into(),
|
||||
stack_a: "reference".into(),
|
||||
stack_b: "under-test".into(),
|
||||
reference_side: Some("a"),
|
||||
version_a: "rustfs 1.0.5".into(),
|
||||
version_b: "rustfs 1.0.6".into(),
|
||||
region_a: None,
|
||||
region_b: None,
|
||||
compared_ops: 1,
|
||||
compared_cases: 1,
|
||||
differences: unruled,
|
||||
accepted_differences: accepted,
|
||||
responses: PairedReceipts::new(&a, &b),
|
||||
};
|
||||
let path = report.write_to(&directory).expect("write accepted report");
|
||||
let json: serde_json::Value =
|
||||
serde_json::from_slice(&std::fs::read(&path).expect("read accepted report")).expect("parse");
|
||||
let _ = std::fs::remove_dir_all(&directory);
|
||||
assert_eq!(json["differences"], serde_json::json!([]));
|
||||
assert_eq!(
|
||||
json["accepted_differences"],
|
||||
serde_json::json!([{
|
||||
"op": "PutBucketPolicy",
|
||||
"case": "negative",
|
||||
"field": "error_code",
|
||||
"a": "InvalidArgument",
|
||||
"b": "MalformedPolicy",
|
||||
"ruling": "rustfs/backlog#2684#issuecomment-7163283798 (commit 8f81762a6)",
|
||||
}])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn accepted_reference_changes_never_apply_in_same_binary_mode() {
|
||||
let a = vec![Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("InvalidArgument".into()),
|
||||
[("content-type", "application/xml")],
|
||||
)];
|
||||
let b = vec![Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("MalformedPolicy".into()),
|
||||
[("content-type", "application/xml")],
|
||||
)];
|
||||
|
||||
let (unruled, accepted) = partition_differences(compare(&a, &b), ComparisonMode::SameBinary, ACCEPTED_REFERENCE_CHANGES);
|
||||
assert!(accepted.is_empty(), "same-binary mode must never accept differences: {accepted:?}");
|
||||
assert_eq!(
|
||||
unruled,
|
||||
vec![Difference {
|
||||
op: "PutBucketPolicy".into(),
|
||||
case: "negative".into(),
|
||||
field: "error_code".into(),
|
||||
a: "InvalidArgument".into(),
|
||||
b: "MalformedPolicy".into(),
|
||||
}]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn accepted_reference_change_fails_closed_on_any_mutation_or_extra_field_diff() {
|
||||
let cases: &[(&str, Observation, Observation, &[&str])] = &[
|
||||
(
|
||||
"wrong candidate error code",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("AccessDenied".into()), []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"missing candidate error code",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 400, None, []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"wrong reference error code",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("MalformedXML".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("MalformedPolicy".into()), []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"swapped reference and candidate error codes",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("MalformedPolicy".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"different operation",
|
||||
Observation::new("GetBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("GetBucketPolicy", "negative", 400, Some("MalformedPolicy".into()), []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"different case",
|
||||
Observation::new("PutBucketPolicy", "normal", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("PutBucketPolicy", "normal", 400, Some("MalformedPolicy".into()), []),
|
||||
&["error_code"],
|
||||
),
|
||||
(
|
||||
"status differs alone",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 500, Some("InvalidArgument".into()), []),
|
||||
&["status"],
|
||||
),
|
||||
(
|
||||
"status also differs alongside matching error_code",
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("PutBucketPolicy", "negative", 500, Some("MalformedPolicy".into()), []),
|
||||
&["status", "error_code"],
|
||||
),
|
||||
(
|
||||
"header also differs alongside matching error_code",
|
||||
Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("InvalidArgument".into()),
|
||||
[("content-type", "application/xml")],
|
||||
),
|
||||
Observation::new(
|
||||
"PutBucketPolicy",
|
||||
"negative",
|
||||
400,
|
||||
Some("MalformedPolicy".into()),
|
||||
[("content-type", "text/plain")],
|
||||
),
|
||||
&["error_code", "header.content-type"],
|
||||
),
|
||||
];
|
||||
|
||||
for (label, obs_a, obs_b, expected_fields) in cases {
|
||||
let (unruled, accepted) = partition_differences(
|
||||
compare(std::slice::from_ref(obs_a), std::slice::from_ref(obs_b)),
|
||||
ComparisonMode::Reference,
|
||||
ACCEPTED_REFERENCE_CHANGES,
|
||||
);
|
||||
assert!(accepted.is_empty(), "case `{label}` must not be accepted, got accepted={accepted:?}");
|
||||
assert_eq!(fields(&unruled), *expected_fields, "case `{label}` must preserve all unruled differences");
|
||||
}
|
||||
|
||||
// An accepted difference on PutBucketPolicy must never mask an unrelated regression.
|
||||
let a = vec![
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("InvalidArgument".into()), []),
|
||||
Observation::new("GetObject", "negative", 404, Some("NoSuchKey".into()), []),
|
||||
];
|
||||
let b = vec![
|
||||
Observation::new("PutBucketPolicy", "negative", 400, Some("MalformedPolicy".into()), []),
|
||||
Observation::new("GetObject", "negative", 404, Some("NoSuchBucket".into()), []),
|
||||
];
|
||||
let (unruled, accepted) = partition_differences(compare(&a, &b), ComparisonMode::Reference, ACCEPTED_REFERENCE_CHANGES);
|
||||
assert_eq!(accepted.len(), 1);
|
||||
assert_eq!(accepted[0].difference.op, "PutBucketPolicy");
|
||||
assert_eq!(unruled.len(), 1);
|
||||
assert_eq!(unruled[0].op, "GetObject");
|
||||
assert_eq!(unruled[0].field, "error_code");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
//! Browser preflight and actual CORS responses from a bucket with a stored rule.
|
||||
use super::{BoxError, RustFSTestEnvironment};
|
||||
use crate::common::signed_request_with_client;
|
||||
use aws_sdk_s3::{
|
||||
primitives::ByteStream,
|
||||
types::{CorsConfiguration, CorsRule},
|
||||
};
|
||||
use http::{
|
||||
HeaderMap, HeaderValue, Method, StatusCode,
|
||||
header::{ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_REQUEST_METHOD, ORIGIN},
|
||||
};
|
||||
use std::{net::SocketAddr, time::Duration};
|
||||
|
||||
const ORIGIN_VALUE: &str = "https://app.example.com";
|
||||
const KEY: &str = "cors-object.txt";
|
||||
const BODY: &[u8] = b"middleware cors object";
|
||||
|
||||
fn assert_allowed_origin(headers: &HeaderMap, expected: Option<&str>) -> Result<(), BoxError> {
|
||||
let mut origins = headers.get_all(ACCESS_CONTROL_ALLOW_ORIGIN).iter();
|
||||
assert_eq!(origins.next().map(HeaderValue::to_str).transpose()?, expected, "CORS allow-origin");
|
||||
assert!(origins.next().is_none(), "duplicate CORS allow-origin header");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) async fn check(env: &RustFSTestEnvironment, bucket: &str) -> Result<(), BoxError> {
|
||||
let s3 = env.create_s3_client();
|
||||
let rule = CorsRule::builder()
|
||||
.allowed_origins(ORIGIN_VALUE)
|
||||
.allowed_methods("GET")
|
||||
.allowed_methods("HEAD")
|
||||
.build()?;
|
||||
s3.put_bucket_cors()
|
||||
.bucket(bucket)
|
||||
.cors_configuration(CorsConfiguration::builder().cors_rules(rule).build()?)
|
||||
.send()
|
||||
.await?;
|
||||
s3.put_object()
|
||||
.bucket(bucket)
|
||||
.key(KEY)
|
||||
.body(ByteStream::from_static(BODY))
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
let address: SocketAddr = env.address.parse()?;
|
||||
assert!(address.ip().is_loopback(), "CORS fixture must run on loopback");
|
||||
let host = format!("{bucket}.s3.test");
|
||||
let client = || {
|
||||
reqwest::Client::builder()
|
||||
.no_proxy()
|
||||
.redirect(reqwest::redirect::Policy::none())
|
||||
.timeout(Duration::from_secs(10))
|
||||
.resolve(&host, address)
|
||||
};
|
||||
let http = client().build()?;
|
||||
let preflight = http
|
||||
.request(Method::OPTIONS, format!("http://{host}:{}/{KEY}", address.port()))
|
||||
.header(ORIGIN, ORIGIN_VALUE)
|
||||
.header(ACCESS_CONTROL_REQUEST_METHOD, "GET")
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(preflight.status(), StatusCode::OK, "virtual-hosted CORS preflight");
|
||||
assert_allowed_origin(preflight.headers(), Some(ORIGIN_VALUE))?;
|
||||
assert!(
|
||||
preflight
|
||||
.headers()
|
||||
.get_all(ACCESS_CONTROL_ALLOW_METHODS)
|
||||
.iter()
|
||||
.filter_map(|v| v.to_str().ok())
|
||||
.flat_map(|v| v.split(','))
|
||||
.any(|method| method.trim() == "GET"),
|
||||
"preflight must allow GET"
|
||||
);
|
||||
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert(ORIGIN, HeaderValue::from_static(ORIGIN_VALUE));
|
||||
let browser = client().default_headers(headers).build()?;
|
||||
let url = format!("{}/{bucket}/{KEY}", env.url);
|
||||
for (client, origin) in [(&browser, Some(ORIGIN_VALUE)), (&http, None)] {
|
||||
let response =
|
||||
signed_request_with_client(client, Method::GET, &url, &env.access_key, &env.secret_key, None, None).await?;
|
||||
assert_eq!(response.status(), StatusCode::OK, "CORS object GET");
|
||||
assert_allowed_origin(response.headers(), origin)?;
|
||||
assert_eq!(response.bytes().await?.as_ref(), BODY, "CORS object GET payload");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
//! Wire contracts for the S3 middleware shared by the candidate and released server.
|
||||
use super::{BoxError, RustFSTestEnvironment, SideA, rustfs_binary_path};
|
||||
|
||||
mod cors;
|
||||
mod object;
|
||||
|
||||
async fn check(side: SideA) -> Result<(), BoxError> {
|
||||
let binary = match side {
|
||||
SideA::SameBinary => rustfs_binary_path(),
|
||||
SideA::Reference(path) => path,
|
||||
};
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
env.start_rustfs_server_from_binary_without_cleanup(
|
||||
&binary,
|
||||
vec![],
|
||||
&[
|
||||
("RUSTFS_CHECK_UPDATE", "false"),
|
||||
("RUSTFS_SERVER_DOMAINS", "s3.test"),
|
||||
("RUSTFS_COMPRESS_ENABLE", "true"),
|
||||
("RUSTFS_COMPRESS_MIN_SIZE", "1000"),
|
||||
("RUSTFS_COMPRESS_MIME_TYPES", "text/*"),
|
||||
("RUSTFS_COMPRESS_EXTENSIONS", ""),
|
||||
],
|
||||
)
|
||||
.await?;
|
||||
let bucket = format!("middleware-{}", uuid::Uuid::new_v4().simple());
|
||||
env.create_s3_client().create_bucket().bucket(&bucket).send().await?;
|
||||
cors::check(&env, &bucket).await?;
|
||||
object::check(&env, &bucket).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn current_middleware_contract() -> Result<(), BoxError> {
|
||||
check(SideA::SameBinary).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn reference_middleware_contract() -> Result<(), BoxError> {
|
||||
check(SideA::from_env()?).await
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
use super::{BoxError, RustFSTestEnvironment};
|
||||
use crate::common::signed_request_with_client;
|
||||
use aws_sdk_s3::{
|
||||
presigning::{PresignedRequest, PresigningConfig},
|
||||
primitives::ByteStream,
|
||||
types::ObjectAttributes,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use flate2::read::GzDecoder;
|
||||
use http::{HeaderMap, HeaderValue, Method, StatusCode, Version, header};
|
||||
use http_body_util::{BodyExt, Empty};
|
||||
use hyper_util::{client::legacy::Client, rt::TokioExecutor};
|
||||
use md5::{Digest, Md5};
|
||||
use std::io::Read;
|
||||
use std::time::Duration;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::time::timeout;
|
||||
|
||||
async fn request(
|
||||
env: &RustFSTestEnvironment,
|
||||
method: Method,
|
||||
url: &str,
|
||||
headers: HeaderMap,
|
||||
) -> Result<reqwest::Response, BoxError> {
|
||||
let client = reqwest::Client::builder()
|
||||
.no_proxy()
|
||||
.no_gzip()
|
||||
.redirect(reqwest::redirect::Policy::none())
|
||||
.default_headers(headers)
|
||||
.http1_only()
|
||||
.build()?;
|
||||
let response = signed_request_with_client(&client, method, url, &env.access_key, &env.secret_key, None, None).await?;
|
||||
assert_eq!(response.version(), Version::HTTP_11);
|
||||
Ok(response)
|
||||
}
|
||||
|
||||
// HTTP clients discard HEAD bodies. Read through EOF so an illegal body fails the contract.
|
||||
async fn head_on_wire(env: &RustFSTestEnvironment, bucket: &str, expected: StatusCode) -> Result<HeaderMap, BoxError> {
|
||||
let signed = env
|
||||
.create_s3_client()
|
||||
.head_object()
|
||||
.bucket(bucket)
|
||||
.key("normal.txt")
|
||||
.presigned(PresigningConfig::expires_in(Duration::from_secs(60))?)
|
||||
.await?;
|
||||
let uri: http::Uri = signed.uri().parse()?;
|
||||
assert_eq!(uri.authority().map(|a| a.as_str()), Some(env.address.as_str()));
|
||||
let target = uri.path_and_query().ok_or("missing HEAD target")?;
|
||||
let mut request = format!("HEAD {target} HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n", env.address);
|
||||
for (name, value) in signed.headers() {
|
||||
use std::fmt::Write;
|
||||
write!(request, "{name}: {value}\r\n")?;
|
||||
}
|
||||
request.push_str("\r\n");
|
||||
|
||||
const LIMIT: usize = 64 * 1024;
|
||||
let mut reply = Vec::new();
|
||||
timeout(Duration::from_secs(10), async {
|
||||
let mut stream = TcpStream::connect(&env.address).await?;
|
||||
stream.write_all(request.as_bytes()).await?;
|
||||
stream.take((LIMIT + 1) as u64).read_to_end(&mut reply).await
|
||||
})
|
||||
.await??;
|
||||
assert!(reply.len() <= LIMIT, "HEAD response exceeds limit");
|
||||
let end = reply
|
||||
.windows(4)
|
||||
.position(|v| v == b"\r\n\r\n")
|
||||
.ok_or("incomplete HEAD response")?;
|
||||
assert_eq!(reply.len(), end + 4, "unexpected body bytes after HEAD response headers");
|
||||
let mut lines = std::str::from_utf8(&reply[..end])?.split("\r\n");
|
||||
let mut status = lines.next().ok_or("missing HEAD status line")?.split_ascii_whitespace();
|
||||
assert_eq!(status.next(), Some("HTTP/1.1"));
|
||||
assert_eq!(status.next(), Some(expected.as_str()));
|
||||
let mut headers = HeaderMap::new();
|
||||
for line in lines {
|
||||
let (name, value) = line.split_once(':').ok_or("invalid HEAD response header")?;
|
||||
headers.append(header::HeaderName::from_bytes(name.as_bytes())?, HeaderValue::from_str(value.trim())?);
|
||||
}
|
||||
Ok(headers)
|
||||
}
|
||||
|
||||
async fn check_h2_body(signed: PresignedRequest, status: StatusCode, expected: &[u8]) -> Result<(), BoxError> {
|
||||
let client = Client::builder(TokioExecutor::new()).http2_only(true).build_http();
|
||||
let mut req = signed.into_http_1x_request(Empty::<Bytes>::new());
|
||||
req.headers_mut()
|
||||
.insert(header::ACCEPT_ENCODING, HeaderValue::from_static("identity"));
|
||||
timeout(Duration::from_secs(10), async {
|
||||
let response = client.request(req).await?;
|
||||
assert_eq!(response.version(), Version::HTTP_2);
|
||||
assert_eq!(response.status(), status);
|
||||
let mut body = response.into_body();
|
||||
let mut frames = 0;
|
||||
let mut received = 0;
|
||||
while let Some(frame) = body.frame().await {
|
||||
if let Ok(data) = frame?.into_data() {
|
||||
frames += 1;
|
||||
assert!(expected[received..].starts_with(&data), "HTTP/2 DATA differs from stored content");
|
||||
received += data.len();
|
||||
}
|
||||
}
|
||||
assert_eq!(received, expected.len());
|
||||
assert_eq!(frames == 0, expected.is_empty(), "unexpected HTTP/2 DATA frame count for {status}");
|
||||
Ok::<_, BoxError>(())
|
||||
})
|
||||
.await?
|
||||
}
|
||||
|
||||
pub(super) async fn check(env: &RustFSTestEnvironment, bucket: &str) -> Result<(), BoxError> {
|
||||
let sdk = env.create_s3_client();
|
||||
let text = b"ordinary middleware payload\n".repeat(1200);
|
||||
let png = b"image-control\0".repeat(2000);
|
||||
let short = b"hello".as_slice();
|
||||
for (key, body, mime) in [
|
||||
("normal.txt", text.as_slice(), "text/plain"),
|
||||
("short.txt", short, "text/plain"),
|
||||
("image.png", png.as_slice(), "image/png"),
|
||||
] {
|
||||
sdk.put_object()
|
||||
.bucket(bucket)
|
||||
.key(key)
|
||||
.content_type(mime)
|
||||
.body(ByteStream::from(body.to_vec()))
|
||||
.send()
|
||||
.await?;
|
||||
}
|
||||
let root = format!("{}/{bucket}", env.url);
|
||||
let url = format!("{root}/normal.txt");
|
||||
let digest = hex_simd::encode_to_string(Md5::digest(&text), hex_simd::AsciiCase::Lower);
|
||||
let etag = format!("\"{digest}\"");
|
||||
|
||||
let head = head_on_wire(env, bucket, StatusCode::OK).await?;
|
||||
assert_eq!(head[header::ETAG], etag.as_str());
|
||||
assert_eq!(head[header::CONTENT_LENGTH].to_str()?.parse::<usize>()?, text.len());
|
||||
|
||||
for (key, accepted, expected_encoding, expected_body) in [
|
||||
("normal.txt", "gzip", "gzip", text.as_slice()),
|
||||
("normal.txt", "identity", "identity", text.as_slice()),
|
||||
("short.txt", "gzip", "identity", short),
|
||||
("image.png", "gzip", "identity", png.as_slice()),
|
||||
] {
|
||||
let headers = HeaderMap::from_iter([(header::ACCEPT_ENCODING, HeaderValue::from_static(accepted))]);
|
||||
let res = request(env, Method::GET, &format!("{root}/{key}"), headers).await?;
|
||||
assert_eq!(res.status(), StatusCode::OK, "{key} accepting {accepted}");
|
||||
let encoding = res
|
||||
.headers()
|
||||
.get(header::CONTENT_ENCODING)
|
||||
.map(HeaderValue::to_str)
|
||||
.transpose()?
|
||||
.unwrap_or("identity");
|
||||
assert_eq!(encoding, expected_encoding, "{key} accepting {accepted}");
|
||||
let bytes = res.bytes().await?;
|
||||
if expected_encoding == "gzip" {
|
||||
let mut decoded = Vec::new();
|
||||
GzDecoder::new(bytes.as_ref()).read_to_end(&mut decoded)?;
|
||||
assert!(decoded == expected_body, "decompressed {key} differs from stored bytes");
|
||||
} else {
|
||||
assert!(bytes.as_ref() == expected_body, "{key} differs from stored bytes");
|
||||
}
|
||||
}
|
||||
|
||||
let headers = HeaderMap::from_iter([
|
||||
(header::RANGE, HeaderValue::from_static("bytes=5-19")),
|
||||
(header::ACCEPT_ENCODING, HeaderValue::from_static("identity")),
|
||||
]);
|
||||
let range = request(env, Method::GET, &url, headers).await?;
|
||||
assert_eq!(range.status(), StatusCode::PARTIAL_CONTENT);
|
||||
assert_eq!(range.headers()[header::CONTENT_RANGE], format!("bytes 5-19/{}", text.len()));
|
||||
assert_eq!(range.bytes().await?.as_ref(), &text[5..20]);
|
||||
|
||||
for (condition, expected, body) in [
|
||||
(etag.as_str(), StatusCode::NOT_MODIFIED, [].as_slice()),
|
||||
("\"other-etag\"", StatusCode::OK, text.as_slice()),
|
||||
] {
|
||||
let signed = sdk
|
||||
.get_object()
|
||||
.bucket(bucket)
|
||||
.key("normal.txt")
|
||||
.if_none_match(condition)
|
||||
.presigned(PresigningConfig::expires_in(Duration::from_secs(60))?)
|
||||
.await?;
|
||||
check_h2_body(signed, expected, body).await?;
|
||||
}
|
||||
|
||||
let attrs = sdk
|
||||
.get_object_attributes()
|
||||
.bucket(bucket)
|
||||
.key("normal.txt")
|
||||
.object_attributes(ObjectAttributes::Etag)
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(attrs.e_tag(), Some(digest.as_str()));
|
||||
|
||||
let deleted = sdk
|
||||
.delete_object()
|
||||
.bucket(bucket)
|
||||
.key("normal.txt")
|
||||
.presigned(PresigningConfig::expires_in(Duration::from_secs(60))?)
|
||||
.await?;
|
||||
check_h2_body(deleted, StatusCode::NO_CONTENT, &[]).await?;
|
||||
head_on_wire(env, bucket, StatusCode::NOT_FOUND).await?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -12,49 +12,45 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Differential: two `rustfs` processes, one SDK script (rustfs/backlog#2740).
|
||||
//! Dual-stack differential: one `rustfs` binary, two processes, one SDK script (rustfs/backlog#2740).
|
||||
//!
|
||||
//! Side B is the binary under test. Side A is the binary under test too, unless
|
||||
//! `RUSTFS_E2E_REFERENCE_BINARY` names a released binary: then A is that binary, and a bad path
|
||||
//! fails the run instead of falling back (see `reference`). The report names which side is the
|
||||
//! reference and the `--version` each side ran. `RUSTFS_E2E_STACK_B_REGION`, when set, starts B
|
||||
//! in another region so that a difference can be injected by hand. Neither side is given the
|
||||
//! retired stack selector: the binary under test refuses to start with it, and the gateway stack
|
||||
//! is its only S3 stack. Both servers
|
||||
//! Stack A runs `RUSTFS_S3_STACK=legacy` of the binary under test, unless `RUSTFS_E2E_REFERENCE_BINARY`
|
||||
//! names a released binary: then A is that binary, started without `RUSTFS_S3_STACK` (older
|
||||
//! releases do not know it), and a bad path fails the run instead of falling back (see
|
||||
//! `reference`). The report names which side is the reference and the `--version` each side ran. Stack B runs the value of `RUSTFS_E2E_STACK_B`
|
||||
//! (default `legacy` until the gateway stack is assembled), and `RUSTFS_E2E_STACK_B_REGION`, when
|
||||
//! set, starts B in another region so that a difference can be injected by hand. Both servers
|
||||
//! answer the script in `scenarios`, which covers every operation of `impl S3 for FS`; `compare`
|
||||
//! reports each `(op, field, a, b)` on which the answers differ, and every run writes its report
|
||||
//! to `<target>/dual-stack/<run>.json`. Two processes, not two embedded servers: bucket metadata
|
||||
//! is process-global, so two stacks in one process would read each other's buckets.
|
||||
|
||||
mod compare;
|
||||
mod middleware_contract;
|
||||
mod observability_contract;
|
||||
pub(crate) mod reference;
|
||||
mod reference;
|
||||
mod scenarios;
|
||||
|
||||
use crate::common::{RustFSTestEnvironment, init_logging, rustfs_binary_path, workspace_root};
|
||||
use compare::{
|
||||
ACCEPTED_REFERENCE_CHANGES, ComparisonMode, Difference, Observation, PairedReceipts, Report, compare, compared_cases,
|
||||
compared_ops, partition_differences, render, render_accepted,
|
||||
};
|
||||
use compare::{Difference, Observation, Report, compare, compared_cases, compared_ops, render};
|
||||
use reference::{SideA, binary_version};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
type BoxError = Box<dyn std::error::Error + Send + Sync>;
|
||||
|
||||
/// Label of a side that runs the binary under test.
|
||||
const UNDER_TEST: &str = "under-test";
|
||||
const STACK_A: &str = "legacy";
|
||||
/// Label of side A in the report when it is the released reference binary.
|
||||
const STACK_A_REFERENCE: &str = "reference";
|
||||
const ENV_STACK_B: &str = "RUSTFS_E2E_STACK_B";
|
||||
const ENV_STACK_B_REGION: &str = "RUSTFS_E2E_STACK_B_REGION";
|
||||
/// Becomes `gateway` once rustfs/backlog#2734 T2.5 assembles the gateway stack.
|
||||
const DEFAULT_STACK_B: &str = "legacy";
|
||||
/// The region the negative control gives stack A explicitly, so an inherited `RUSTFS_REGION`
|
||||
/// cannot erase the injected difference. Not `us-east-1`: that region answers GetBucketLocation
|
||||
/// with an empty LocationConstraint and re-creating an owned bucket with 200, so it would not
|
||||
/// report its own name and would add CreateBucket differences to the control.
|
||||
const CONTROL_REGION_A: &str = "us-west-2";
|
||||
const CONTROL_REGION_B: &str = "eu-west-1";
|
||||
/// `normal` cases side A must answer with a 2xx. The comparison alone cannot tell a
|
||||
/// `normal` cases the legacy stack must answer with a 2xx. The comparison alone cannot tell a
|
||||
/// script that exercises real behavior from one in which both stacks fail the same way. Five of
|
||||
/// the 73 fail on legacy by design of this script: PutBucketReplication (no registered remote
|
||||
/// target), GetBucketReplication (so no configuration), PutBucketNotificationConfiguration (no
|
||||
@@ -64,6 +60,7 @@ const MIN_NORMAL_SUCCESSES: usize = 68;
|
||||
|
||||
struct PairConfig {
|
||||
side_a: SideA,
|
||||
stack_b: String,
|
||||
region_a: Option<String>,
|
||||
region_b: Option<String>,
|
||||
}
|
||||
@@ -72,6 +69,7 @@ impl PairConfig {
|
||||
fn from_env() -> Result<Self, BoxError> {
|
||||
Ok(Self {
|
||||
side_a: SideA::from_env()?,
|
||||
stack_b: std::env::var(ENV_STACK_B).unwrap_or_else(|_| DEFAULT_STACK_B.to_owned()),
|
||||
region_a: None,
|
||||
region_b: std::env::var(ENV_STACK_B_REGION).ok(),
|
||||
})
|
||||
@@ -79,23 +77,16 @@ impl PairConfig {
|
||||
|
||||
fn stack_a_label(&self) -> &'static str {
|
||||
match self.side_a {
|
||||
SideA::SameBinary => UNDER_TEST,
|
||||
SideA::SameBinary => STACK_A,
|
||||
SideA::Reference(_) => STACK_A_REFERENCE,
|
||||
}
|
||||
}
|
||||
|
||||
fn comparison_mode(&self) -> ComparisonMode {
|
||||
match self.side_a {
|
||||
SideA::SameBinary => ComparisonMode::SameBinary,
|
||||
SideA::Reference(_) => ComparisonMode::Reference,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Starts one server of the binary under test, overriding its region only when asked.
|
||||
async fn start_under_test(region: Option<&str>) -> Result<RustFSTestEnvironment, BoxError> {
|
||||
/// Starts one server of the binary under test on `stack`, overriding its region only when asked.
|
||||
async fn start_stack(stack: &str, region: Option<&str>) -> Result<RustFSTestEnvironment, BoxError> {
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
let mut vars = Vec::new();
|
||||
let mut vars = vec![("RUSTFS_S3_STACK", stack)];
|
||||
if let Some(region) = region {
|
||||
vars.push(("RUSTFS_REGION", region));
|
||||
}
|
||||
@@ -103,7 +94,8 @@ async fn start_under_test(region: Option<&str>) -> Result<RustFSTestEnvironment,
|
||||
Ok(env)
|
||||
}
|
||||
|
||||
/// Starts one server of a released binary.
|
||||
/// Starts one server of a released binary. `RUSTFS_S3_STACK` is not passed: older releases do not
|
||||
/// know it and have exactly one stack.
|
||||
async fn start_reference(binary: &Path, region: Option<&str>) -> Result<RustFSTestEnvironment, BoxError> {
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
let mut vars = Vec::new();
|
||||
@@ -119,11 +111,11 @@ async fn start_reference(binary: &Path, region: Option<&str>) -> Result<RustFSTe
|
||||
async fn spawn_pair(config: &PairConfig) -> Result<(RustFSTestEnvironment, RustFSTestEnvironment), BoxError> {
|
||||
let side_a = async {
|
||||
match &config.side_a {
|
||||
SideA::SameBinary => start_under_test(config.region_a.as_deref()).await,
|
||||
SideA::SameBinary => start_stack(STACK_A, config.region_a.as_deref()).await,
|
||||
SideA::Reference(binary) => start_reference(binary, config.region_a.as_deref()).await,
|
||||
}
|
||||
};
|
||||
tokio::try_join!(side_a, start_under_test(config.region_b.as_deref()))
|
||||
tokio::try_join!(side_a, start_stack(&config.stack_b, config.region_b.as_deref()))
|
||||
}
|
||||
|
||||
fn report_directory() -> PathBuf {
|
||||
@@ -164,13 +156,11 @@ async fn run_differential(label: &str, config: &PairConfig) -> Run {
|
||||
let millis = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.map_or(0, |elapsed| elapsed.as_millis());
|
||||
let (differences, accepted_differences) =
|
||||
partition_differences(compare(&a, &b), config.comparison_mode(), ACCEPTED_REFERENCE_CHANGES);
|
||||
let report = Report {
|
||||
schema: 2,
|
||||
run: format!("{label}-{millis}-{}", std::process::id()),
|
||||
stack_a: config.stack_a_label().to_owned(),
|
||||
stack_b: UNDER_TEST.to_owned(),
|
||||
stack_b: config.stack_b.clone(),
|
||||
reference_side: matches!(config.side_a, SideA::Reference(_)).then_some("a"),
|
||||
version_a,
|
||||
version_b,
|
||||
@@ -178,9 +168,7 @@ async fn run_differential(label: &str, config: &PairConfig) -> Run {
|
||||
region_b: config.region_b.clone(),
|
||||
compared_ops: compared_ops(&a, &b).len(),
|
||||
compared_cases: compared_cases(&a, &b),
|
||||
differences,
|
||||
accepted_differences,
|
||||
responses: PairedReceipts::new(&a, &b),
|
||||
differences: compare(&a, &b),
|
||||
};
|
||||
let path = report.write_to(&report_directory()).expect("write the dual-stack report");
|
||||
Run { report, path, a }
|
||||
@@ -206,23 +194,6 @@ mod tests {
|
||||
"the script must drive exactly the operations of impl S3 for FS"
|
||||
);
|
||||
assert_eq!(report.compared_ops, scenarios::OPERATIONS.len(), "report: {}", run.path.display());
|
||||
if config.comparison_mode() == ComparisonMode::SameBinary {
|
||||
assert!(
|
||||
report.accepted_differences.is_empty(),
|
||||
"same-binary comparison must never accept differences (report: {}):\n{}",
|
||||
run.path.display(),
|
||||
render_accepted(&report.accepted_differences)
|
||||
);
|
||||
}
|
||||
if !report.accepted_differences.is_empty() {
|
||||
println!(
|
||||
"accepted reference differences ({} of {} cases, report: {}):\n{}",
|
||||
report.accepted_differences.len(),
|
||||
report.compared_cases,
|
||||
run.path.display(),
|
||||
render_accepted(&report.accepted_differences)
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
report.differences.is_empty(),
|
||||
"stack {} ({}) and stack {} ({}) differ on {} of {} cases (report: {}):\n{}",
|
||||
@@ -264,6 +235,7 @@ mod tests {
|
||||
init_logging();
|
||||
let config = PairConfig {
|
||||
side_a: SideA::SameBinary,
|
||||
stack_b: STACK_A.to_owned(),
|
||||
region_a: Some(CONTROL_REGION_A.to_owned()),
|
||||
region_b: Some(CONTROL_REGION_B.to_owned()),
|
||||
};
|
||||
@@ -275,12 +247,6 @@ mod tests {
|
||||
a: CONTROL_REGION_A.to_owned(),
|
||||
b: CONTROL_REGION_B.to_owned(),
|
||||
};
|
||||
assert!(
|
||||
run.report.accepted_differences.is_empty(),
|
||||
"same-binary negative control must never accept differences (report: {}):\n{}",
|
||||
run.path.display(),
|
||||
render_accepted(&run.report.accepted_differences)
|
||||
);
|
||||
assert!(
|
||||
run.report.differences.contains(&expected),
|
||||
"B started in {CONTROL_REGION_B} but GetBucketLocation was not reported (report: {}):\n{}",
|
||||
|
||||
@@ -1,415 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
//! SDK responses, audit receipts and HTTP counters for isolated successful PUTs and a missing-object GET.
|
||||
use super::reference::{SideA, binary_version};
|
||||
use super::{BoxError, RustFSTestEnvironment, rustfs_binary_path};
|
||||
use crate::common::admin_request;
|
||||
use aws_sdk_s3::{operation::RequestId, primitives::ByteStream};
|
||||
use bytes::Bytes;
|
||||
use flate2::read::GzDecoder;
|
||||
use http_body_util::{BodyExt, Empty, Limited};
|
||||
use hyper::{Method, Request, Response, StatusCode, body::Incoming, service::service_fn};
|
||||
use hyper_util::rt::TokioIo;
|
||||
use md5::{Digest, Md5};
|
||||
use opentelemetry_proto::tonic::{
|
||||
collector::metrics::v1::ExportMetricsServiceRequest,
|
||||
common::v1::{KeyValue, any_value},
|
||||
metrics::v1::{metric::Data, number_data_point},
|
||||
};
|
||||
use prost::Message;
|
||||
use rustfs_madmin::metrics::RealtimeMetrics;
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::convert::Infallible;
|
||||
use std::io::Read;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
use tokio::net::TcpListener;
|
||||
use tokio::task::JoinSet;
|
||||
use tokio::time::{sleep, timeout};
|
||||
|
||||
const BODY: &[u8] = b"observability contract";
|
||||
const HTTP_COUNTER: &str = "rustfs_s3_http_requests_total";
|
||||
const PUT: &str = "s3:PutObject";
|
||||
const MAX_EXPORT: usize = 8 * 1024 * 1024;
|
||||
const CONTRACT: &str = include_str!("../../../gateway-adapter/tests/fixtures/observability-contract.json");
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Contract {
|
||||
reference_version: String,
|
||||
sdk_puts: u64,
|
||||
s3_metrics: BTreeMap<String, BTreeSet<String>>,
|
||||
audit_fields: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default)]
|
||||
struct HttpCounts {
|
||||
put_success: u64,
|
||||
get_error: u64,
|
||||
}
|
||||
|
||||
impl HttpCounts {
|
||||
fn series(&mut self, method: &str, op: &str, outcome: &str) -> Option<&mut u64> {
|
||||
match (method, op, outcome) {
|
||||
("PUT", PUT, "2xx") => Some(&mut self.put_success),
|
||||
("GET", "s3:GetObject", "4xx") => Some(&mut self.get_error),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct Observations {
|
||||
labels: BTreeMap<String, BTreeSet<String>>,
|
||||
exports: usize,
|
||||
http: HttpCounts,
|
||||
audits: BTreeMap<String, String>,
|
||||
error: Option<&'static str>,
|
||||
}
|
||||
|
||||
impl Observations {
|
||||
fn audit(&mut self, event: &Value, bucket: &str, contract: &Contract) -> Result<(), &'static str> {
|
||||
if event.pointer("/api/name").and_then(Value::as_str) != Some(PUT)
|
||||
|| event.pointer("/api/bucket").and_then(Value::as_str) != Some(bucket)
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
if !contract.audit_fields.iter().all(|field| event.pointer(field).is_some()) {
|
||||
return Err("successful PUT audit omitted a required field");
|
||||
}
|
||||
if event.pointer("/api/status_code").and_then(Value::as_u64) != Some(200) {
|
||||
return Err("unexpected audited PUT status");
|
||||
}
|
||||
let id = event["requestID"]
|
||||
.as_str()
|
||||
.filter(|id| !id.is_empty())
|
||||
.ok_or("audit omitted request ID")?;
|
||||
let object = event["api"]["object"].as_str().ok_or("audit omitted object")?;
|
||||
if self.audits.insert(id.to_owned(), object.to_owned()).is_some() {
|
||||
return Err("duplicate PUT audit delivery");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn metrics(&mut self, export: ExportMetricsServiceRequest, contract: &Contract) -> Result<(), &'static str> {
|
||||
for metric in export
|
||||
.resource_metrics
|
||||
.into_iter()
|
||||
.flat_map(|r| r.scope_metrics)
|
||||
.flat_map(|s| s.metrics)
|
||||
{
|
||||
if !contract.s3_metrics.contains_key(&metric.name) {
|
||||
continue;
|
||||
}
|
||||
let mut record = |attrs: &[KeyValue]| {
|
||||
self.labels
|
||||
.entry(metric.name.clone())
|
||||
.or_default()
|
||||
.extend(attrs.iter().map(|kv| kv.key.clone()));
|
||||
};
|
||||
match metric.data {
|
||||
Some(Data::Gauge(gauge)) => gauge.data_points.iter().for_each(|p| record(&p.attributes)),
|
||||
Some(Data::Histogram(hist)) => hist.data_points.iter().for_each(|p| record(&p.attributes)),
|
||||
Some(Data::Sum(sum)) => {
|
||||
for point in sum.data_points {
|
||||
record(&point.attributes);
|
||||
if metric.name != HTTP_COUNTER {
|
||||
continue;
|
||||
}
|
||||
let attr = |key: &str| {
|
||||
point
|
||||
.attributes
|
||||
.iter()
|
||||
.find(|a| a.key == key)
|
||||
.and_then(|a| match a.value.as_ref()?.value.as_ref()? {
|
||||
any_value::Value::StringValue(value) => Some(value.as_str()),
|
||||
_ => None,
|
||||
})
|
||||
.unwrap_or_default()
|
||||
};
|
||||
if let Some(count) = self.http.series(attr("method"), attr("op"), attr("outcome")) {
|
||||
*count = match point.value {
|
||||
Some(number_data_point::Value::AsInt(n)) => {
|
||||
u64::try_from(n).map_err(|_| "negative HTTP counter")?
|
||||
}
|
||||
Some(number_data_point::Value::AsDouble(n)) if n.is_finite() && n >= 0.0 && n.fract() == 0.0 => {
|
||||
n as u64
|
||||
}
|
||||
_ => return Err("invalid HTTP counter"),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => return Err("unexpected S3 metric aggregation"),
|
||||
}
|
||||
}
|
||||
self.exports += 1;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
async fn collect(
|
||||
req: Request<Incoming>,
|
||||
state: &Mutex<Observations>,
|
||||
bucket: &str,
|
||||
contract: &Contract,
|
||||
) -> Result<(), &'static str> {
|
||||
let (parts, body) = req.into_parts();
|
||||
// WebhookTarget checks the origin before delivering events to /audit.
|
||||
if parts.method == Method::HEAD && parts.uri == "/" {
|
||||
return Ok(());
|
||||
}
|
||||
if parts.method != Method::POST {
|
||||
return Err("unexpected collector method");
|
||||
}
|
||||
let bytes = Limited::new(body, MAX_EXPORT)
|
||||
.collect()
|
||||
.await
|
||||
.map_err(|_| "invalid export size")?
|
||||
.to_bytes();
|
||||
let mut decoded = Vec::new();
|
||||
let payload = if parts.headers.get("content-encoding").is_some_and(|v| v == "gzip") {
|
||||
GzDecoder::new(bytes.as_ref())
|
||||
.take(MAX_EXPORT as u64 + 1)
|
||||
.read_to_end(&mut decoded)
|
||||
.map_err(|_| "invalid gzip export")?;
|
||||
if decoded.len() > MAX_EXPORT {
|
||||
return Err("decoded export exceeds limit");
|
||||
}
|
||||
&decoded[..]
|
||||
} else {
|
||||
&bytes[..]
|
||||
};
|
||||
match parts.uri.path() {
|
||||
"/audit" => {
|
||||
let document: Value = serde_json::from_slice(payload).map_err(|_| "invalid audit JSON")?;
|
||||
let events = document
|
||||
.get("Records")
|
||||
.and_then(Value::as_array)
|
||||
.map(Vec::as_slice)
|
||||
.unwrap_or(std::slice::from_ref(&document));
|
||||
let mut snapshot = state.lock().expect("collector mutex");
|
||||
for event in events {
|
||||
snapshot.audit(event, bucket, contract)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
"/v1/metrics" => {
|
||||
let export = ExportMetricsServiceRequest::decode(payload).map_err(|_| "invalid OTLP export")?;
|
||||
state.lock().expect("collector mutex").metrics(export, contract)
|
||||
}
|
||||
_ => Err("unexpected collector path"),
|
||||
}
|
||||
}
|
||||
|
||||
async fn listen(listener: TcpListener, state: Arc<Mutex<Observations>>, bucket: String, contract: Arc<Contract>) {
|
||||
let mut connections = JoinSet::new();
|
||||
loop {
|
||||
tokio::select! {
|
||||
Ok((socket, _)) = listener.accept() => {
|
||||
let state = Arc::clone(&state);
|
||||
let contract = Arc::clone(&contract);
|
||||
let bucket = bucket.clone();
|
||||
connections.spawn(async move {
|
||||
let svc = service_fn(|req| async {
|
||||
let result = collect(req, &state, &bucket, &contract).await;
|
||||
let mut response = Response::new(Empty::<Bytes>::new());
|
||||
if let Err(error) = result {
|
||||
state.lock().expect("collector mutex").error = Some(error);
|
||||
*response.status_mut() = StatusCode::BAD_REQUEST;
|
||||
}
|
||||
Ok::<_, Infallible>(response)
|
||||
});
|
||||
let _ = hyper::server::conn::http1::Builder::new().serve_connection(TokioIo::new(socket), svc).await;
|
||||
});
|
||||
}
|
||||
Some(_) = connections.join_next(), if !connections.is_empty() => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn admin_http_counts(env: &RustFSTestEnvironment) -> Result<HttpCounts, BoxError> {
|
||||
let (code, text) = admin_request(
|
||||
&env.url,
|
||||
Method::GET,
|
||||
"/rustfs/admin/v3/realtime?types=512&by-host=true&n=1",
|
||||
None,
|
||||
&env.access_key,
|
||||
&env.secret_key,
|
||||
)
|
||||
.await?;
|
||||
assert_eq!(code, StatusCode::OK, "read realtime HTTP counters");
|
||||
let report: RealtimeMetrics = serde_json::from_str(text.lines().next().ok_or("empty admin metrics")?)?;
|
||||
assert!(report.errors.is_empty(), "admin reported metric collection errors");
|
||||
let http = report.aggregated.http.ok_or("missing admin HTTP metrics")?;
|
||||
let mut counts = HttpCounts::default();
|
||||
for row in http.requests {
|
||||
if let Some(total) = counts.series(&row.method, &row.operation, &row.outcome) {
|
||||
*total += row.total;
|
||||
}
|
||||
}
|
||||
Ok(counts)
|
||||
}
|
||||
|
||||
async fn wait_for(state: &Mutex<Observations>, ready: impl Fn(&Observations) -> bool) -> Result<(), BoxError> {
|
||||
timeout(Duration::from_secs(45), async {
|
||||
loop {
|
||||
{
|
||||
let s = state.lock().expect("collector mutex");
|
||||
if let Some(e) = s.error {
|
||||
return Err::<(), BoxError>(e.into());
|
||||
}
|
||||
if ready(&s) {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
sleep(Duration::from_millis(150)).await;
|
||||
}
|
||||
})
|
||||
.await
|
||||
.map_err(|_| {
|
||||
let snapshot = state.lock().expect("collector mutex");
|
||||
format!(
|
||||
"timed out after {} OTLP exports, {} successful PUTs, {} failed GETs, {} audit receipts and {} S3 metrics",
|
||||
snapshot.exports,
|
||||
snapshot.http.put_success,
|
||||
snapshot.http.get_error,
|
||||
snapshot.audits.len(),
|
||||
snapshot.labels.len()
|
||||
)
|
||||
})?
|
||||
}
|
||||
|
||||
async fn check(side: SideA) -> Result<(), BoxError> {
|
||||
let contract: Arc<Contract> = Arc::new(serde_json::from_str(CONTRACT)?);
|
||||
assert_eq!(contract.sdk_puts, 20);
|
||||
let (label, binary) = match &side {
|
||||
SideA::Reference(path) => ("reference", path.clone()),
|
||||
SideA::SameBinary => ("under-test", rustfs_binary_path()),
|
||||
};
|
||||
eprintln!(
|
||||
"observability {label}: {}; fixture {}",
|
||||
binary_version(&binary).await?,
|
||||
contract.reference_version
|
||||
);
|
||||
let bucket = format!("observability-{}", uuid::Uuid::new_v4().simple());
|
||||
let listener = TcpListener::bind(("127.0.0.1", 0)).await?;
|
||||
let origin = format!("http://{}", listener.local_addr()?);
|
||||
let audit = format!("{origin}/audit");
|
||||
let metrics = format!("{origin}/v1/metrics");
|
||||
let state = Arc::new(Mutex::new(Observations::default()));
|
||||
let mut collector = JoinSet::new();
|
||||
collector.spawn(listen(listener, Arc::clone(&state), bucket.clone(), Arc::clone(&contract)));
|
||||
let mut env = RustFSTestEnvironment::new().await?;
|
||||
let queue = format!("{}/queue", env.temp_dir);
|
||||
let vars = [
|
||||
("RUSTFS_OUTBOUND_ALLOW_ORIGINS", origin.as_str()),
|
||||
("RUSTFS_CHECK_UPDATE", "false"),
|
||||
("RUSTFS_AUDIT_ENABLE", "true"),
|
||||
("RUSTFS_AUDIT_WEBHOOK_ENABLE_CONTRACT", "on"),
|
||||
("RUSTFS_AUDIT_WEBHOOK_ENDPOINT_CONTRACT", audit.as_str()),
|
||||
("RUSTFS_AUDIT_WEBHOOK_QUEUE_DIR_CONTRACT", queue.as_str()),
|
||||
("RUSTFS_OBS_METRIC_ENDPOINT", metrics.as_str()),
|
||||
("RUSTFS_OBS_METER_INTERVAL", "1"),
|
||||
("RUSTFS_OBS_METRICS_EXPORT_ENABLED", "true"),
|
||||
("RUSTFS_OBS_LOGS_EXPORT_ENABLED", "false"),
|
||||
("RUSTFS_OBS_TRACES_EXPORT_ENABLED", "false"),
|
||||
("NO_PROXY", "127.0.0.1,localhost"),
|
||||
("no_proxy", "127.0.0.1,localhost"),
|
||||
];
|
||||
match side {
|
||||
SideA::SameBinary => env.start_rustfs_server_without_cleanup_with_env(&vars).await?,
|
||||
SideA::Reference(path) => {
|
||||
env.start_rustfs_server_from_binary_without_cleanup(&path, vec![], &vars)
|
||||
.await?
|
||||
}
|
||||
};
|
||||
let client = env.create_s3_client();
|
||||
client.create_bucket().bucket(&bucket).send().await?;
|
||||
wait_for(&state, |s| s.exports > 0 && s.labels.contains_key(HTTP_COUNTER)).await?;
|
||||
let start = state.lock().expect("collector mutex").http;
|
||||
let before = admin_http_counts(&env).await?;
|
||||
let mut expected = BTreeMap::new();
|
||||
let etag = format!("\"{}\"", hex_simd::encode_to_string(Md5::digest(BODY), hex_simd::AsciiCase::Lower));
|
||||
for i in 0..contract.sdk_puts {
|
||||
let key = format!("contract-{i}");
|
||||
let output = client
|
||||
.put_object()
|
||||
.bucket(&bucket)
|
||||
.key(&key)
|
||||
.body(ByteStream::from_static(BODY))
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(output.e_tag(), Some(etag.as_str()), "stored PUT payload ETag");
|
||||
let id = output
|
||||
.request_id()
|
||||
.filter(|s| !s.is_empty())
|
||||
.ok_or("PUT omitted its request ID")?;
|
||||
assert!(expected.insert(id.to_owned(), key).is_none(), "duplicate SDK request ID");
|
||||
}
|
||||
let missing = client
|
||||
.get_object()
|
||||
.bucket(&bucket)
|
||||
.key("never-written")
|
||||
.send()
|
||||
.await
|
||||
.expect_err("GET of a missing object must fail");
|
||||
assert_eq!(missing.raw_response().map(|r| r.status().as_u16()), Some(404));
|
||||
assert!(
|
||||
missing.as_service_error().is_some_and(|err| err.is_no_such_key()),
|
||||
"missing-object GET must return NoSuchKey"
|
||||
);
|
||||
let after = admin_http_counts(&env).await?;
|
||||
assert_eq!(after.put_success.checked_sub(before.put_success), Some(contract.sdk_puts));
|
||||
assert_eq!(after.get_error.checked_sub(before.get_error), Some(1), "admin GetObject 4xx delta");
|
||||
client.list_objects_v2().bucket(&bucket).send().await?;
|
||||
wait_for(&state, |s| {
|
||||
s.http.put_success >= start.put_success + contract.sdk_puts
|
||||
&& s.http.get_error > start.get_error
|
||||
&& s.audits.len() >= expected.len()
|
||||
&& s.labels.len() == contract.s3_metrics.len()
|
||||
})
|
||||
.await?;
|
||||
// Keep collecting for another export after all PUTs are present to catch late duplicates.
|
||||
let complete_export = state.lock().expect("collector mutex").exports;
|
||||
wait_for(&state, |s| s.exports > complete_export).await?;
|
||||
let observed = state.lock().expect("collector mutex");
|
||||
if let Some(error) = observed.error {
|
||||
return Err(error.into());
|
||||
}
|
||||
assert_eq!(
|
||||
observed.http.put_success.checked_sub(start.put_success),
|
||||
Some(contract.sdk_puts),
|
||||
"OTLP PUT delta"
|
||||
);
|
||||
assert_eq!(observed.http.get_error.checked_sub(start.get_error), Some(1), "OTLP GetObject 4xx delta");
|
||||
assert!(
|
||||
observed.audits == expected,
|
||||
"audit IDs and objects must match each successful SDK PUT once"
|
||||
);
|
||||
assert_eq!(observed.labels, contract.s3_metrics, "stable S3 metric names and label keys");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn reference_observability_contract() -> Result<(), BoxError> {
|
||||
check(SideA::from_env()?).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn current_observability_contract() -> Result<(), BoxError> {
|
||||
check(SideA::SameBinary).await
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
//! Which binary side A of the differential runs, and what it reports about itself.
|
||||
//!
|
||||
//! `RUSTFS_E2E_REFERENCE_BINARY` names a released `rustfs` binary to use as the reference. Unset,
|
||||
//! side A is the binary under test. Set, it must resolve to an
|
||||
//! side A is the binary under test on `RUSTFS_S3_STACK=legacy`. Set, it must resolve to an
|
||||
//! executable file or the run fails: a reference that was asked for and silently replaced by the
|
||||
//! binary under test would report an agreement with itself as agreement with the release.
|
||||
|
||||
@@ -28,9 +28,9 @@ pub(super) const ENV_REFERENCE_BINARY: &str = "RUSTFS_E2E_REFERENCE_BINARY";
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(super) enum SideA {
|
||||
/// Both sides are the binary under test.
|
||||
/// Both sides are the binary under test; A runs `RUSTFS_S3_STACK=legacy`.
|
||||
SameBinary,
|
||||
/// A is this released binary.
|
||||
/// A is this released binary, started without `RUSTFS_S3_STACK`.
|
||||
Reference(PathBuf),
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ fn is_executable(_metadata: &std::fs::Metadata) -> bool {
|
||||
|
||||
/// What `<binary> --version` printed, trimmed. Fails when the binary does not run, exits
|
||||
/// non-zero, or prints nothing, because an empty version would report nothing as observed.
|
||||
pub(crate) async fn binary_version(binary: &Path) -> Result<String, BoxError> {
|
||||
pub(super) async fn binary_version(binary: &Path) -> Result<String, BoxError> {
|
||||
let output = tokio::process::Command::new(binary).arg("--version").output().await?;
|
||||
if !output.status.success() {
|
||||
return Err(format!("{} --version failed with {}", binary.display(), output.status).into());
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
mod extra;
|
||||
|
||||
use super::compare::{Observation, WireHead};
|
||||
use super::compare::Observation;
|
||||
use crate::common::{RustFSTestEnvironment, build_test_s3_config};
|
||||
use aws_sdk_s3::Client;
|
||||
use aws_sdk_s3::config::interceptors::BeforeDeserializationInterceptorContextRef;
|
||||
@@ -67,11 +67,7 @@ const RETAIN_UNTIL_SECS: i64 = 4_070_908_800;
|
||||
const SELECT_DEADLINE: Duration = Duration::from_secs(30);
|
||||
|
||||
type Fields = Vec<(&'static str, String)>;
|
||||
#[derive(Default, Debug)]
|
||||
struct Captured {
|
||||
wire: Option<WireHead>,
|
||||
sdk: Option<(u16, Vec<(String, String)>)>,
|
||||
}
|
||||
type Captured = (u16, Vec<(String, String)>);
|
||||
|
||||
/// Every method of `impl S3 for FS` in `rustfs/src/storage/ecfs.rs`, by S3 operation name, sorted.
|
||||
/// Derived with
|
||||
@@ -156,11 +152,11 @@ pub(crate) const OPERATIONS: [&str; 73] = [
|
||||
|
||||
/// Records the status and headers of the one response each request receives (retries are off).
|
||||
#[derive(Clone, Debug, Default)]
|
||||
struct ResponseCapture(Arc<Mutex<Captured>>);
|
||||
struct ResponseCapture(Arc<Mutex<Option<Captured>>>);
|
||||
|
||||
impl ResponseCapture {
|
||||
fn take(&self) -> Captured {
|
||||
self.0.lock().map(|mut slot| std::mem::take(&mut *slot)).unwrap_or_default()
|
||||
fn take(&self) -> Option<Captured> {
|
||||
self.0.lock().ok().and_then(|mut slot| slot.take())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,21 +165,6 @@ impl Intercept for ResponseCapture {
|
||||
"dual-stack-response-capture"
|
||||
}
|
||||
|
||||
fn read_after_transmit(
|
||||
&self,
|
||||
context: &BeforeDeserializationInterceptorContextRef<'_>,
|
||||
_runtime_components: &RuntimeComponents,
|
||||
_cfg: &mut ConfigBag,
|
||||
) -> Result<(), BoxError> {
|
||||
let response = context.response();
|
||||
let head = WireHead::new(response.status().as_u16(), response.headers().iter().map(|(name, _)| name));
|
||||
self.0
|
||||
.lock()
|
||||
.map_err(|_| std::io::Error::other("response capture mutex was poisoned"))?
|
||||
.wire = Some(head);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn read_before_deserialization(
|
||||
&self,
|
||||
context: &BeforeDeserializationInterceptorContextRef<'_>,
|
||||
@@ -196,10 +177,11 @@ impl Intercept for ResponseCapture {
|
||||
.iter()
|
||||
.map(|(name, value)| (name.to_owned(), value.to_owned()))
|
||||
.collect();
|
||||
self.0
|
||||
*self
|
||||
.0
|
||||
.lock()
|
||||
.map_err(|_| std::io::Error::other("response capture mutex was poisoned"))?
|
||||
.sdk = Some((response.status().as_u16(), headers));
|
||||
.map_err(|_| std::io::Error::other("response capture mutex was poisoned"))? =
|
||||
Some((response.status().as_u16(), headers));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -295,27 +277,25 @@ impl Recorder {
|
||||
{
|
||||
let _ = self.capture.take();
|
||||
let result = request.await;
|
||||
let captured = self.capture.take();
|
||||
let (status, headers) = captured.sdk.unwrap_or_default();
|
||||
let (status, headers) = self.capture.take().unwrap_or_default();
|
||||
let headers = headers.iter().map(|(name, value)| (name.as_str(), value.as_str()));
|
||||
let (mut observation, output) = match result {
|
||||
match result {
|
||||
Ok(output) => {
|
||||
let observation = fields(&output)
|
||||
.into_iter()
|
||||
.fold(Observation::new(op, case, status, None, headers), |observation, (name, value)| {
|
||||
observation.with_field(name, value)
|
||||
});
|
||||
(observation, Some(output))
|
||||
self.observations.push(observation);
|
||||
Some(output)
|
||||
}
|
||||
Err(error) => {
|
||||
let mut observation = Observation::new(op, case, status, Some(error_code(&error)), headers);
|
||||
observation.message = error.as_service_error().and_then(|e| e.message()).map(str::to_owned);
|
||||
(observation, None)
|
||||
self.observations.push(observation);
|
||||
None
|
||||
}
|
||||
};
|
||||
observation.wire_head = captured.wire;
|
||||
self.observations.push(observation);
|
||||
output
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds a field decoded after the response headers arrived (a streamed body).
|
||||
@@ -1171,64 +1151,6 @@ mod tests {
|
||||
use super::OPERATIONS;
|
||||
use super::{Observation, md5_hex, normalize_sse_c_etags};
|
||||
|
||||
#[tokio::test]
|
||||
async fn head_object_receipt_uses_the_transmitted_headers_before_the_sdk_derives_expires_string() {
|
||||
use super::{Client, Recorder, ResponseCapture, RetryConfig, build_test_s3_config, none};
|
||||
use crate::dual_stack_differential::compare::PairedReceipts;
|
||||
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
|
||||
|
||||
const DATE: &str = "Wed, 21 Oct 2037 07:28:00 GMT";
|
||||
let listener = tokio::net::TcpListener::bind(("127.0.0.1", 0)).await.unwrap();
|
||||
let endpoint = format!("http://{}", listener.local_addr().unwrap());
|
||||
let capture = ResponseCapture::default();
|
||||
let client = Client::from_conf(
|
||||
build_test_s3_config(&endpoint, "test", &uuid::Uuid::new_v4().to_string(), None, "wire-head")
|
||||
.to_builder()
|
||||
.retry_config(RetryConfig::disabled())
|
||||
.interceptor(capture.clone())
|
||||
.build(),
|
||||
);
|
||||
let mut recorder = Recorder {
|
||||
capture,
|
||||
observations: Vec::new(),
|
||||
};
|
||||
let server = async {
|
||||
for (status, extra) in [
|
||||
("200 OK", format!("Expires: {DATE}\r\nETag: \"data\"\r\n")),
|
||||
("404 Not Found", String::new()),
|
||||
] {
|
||||
let (mut socket, _) = listener.accept().await.unwrap();
|
||||
let mut lines = BufReader::new(&mut socket).lines();
|
||||
assert!(lines.next_line().await.unwrap().unwrap().starts_with("HEAD /bucket/key "));
|
||||
while !lines.next_line().await.unwrap().unwrap().is_empty() {}
|
||||
let response = format!("HTTP/1.1 {status}\r\n{extra}Content-Length: 0\r\nConnection: close\r\n\r\n");
|
||||
socket.write_all(response.as_bytes()).await.unwrap();
|
||||
}
|
||||
};
|
||||
let requests = async {
|
||||
let head = || client.head_object().bucket("bucket").key("key").send();
|
||||
let output = recorder.step("HeadObject", "expires", head(), none).await.unwrap();
|
||||
assert_eq!(output.expires_string(), Some(DATE));
|
||||
assert!(recorder.step("HeadObject", "absent", head(), none).await.is_none());
|
||||
let absent = recorder
|
||||
.step("HeadObject", "unsent", client.head_object().key("key").send(), none)
|
||||
.await;
|
||||
assert!(absent.is_none());
|
||||
};
|
||||
tokio::time::timeout(std::time::Duration::from_secs(10), async { tokio::join!(server, requests) })
|
||||
.await
|
||||
.unwrap();
|
||||
let (a, b) = recorder.observations.split_at(1);
|
||||
let receipts = serde_json::to_value(PairedReceipts::new(a, b)).unwrap();
|
||||
assert_eq!(
|
||||
receipts,
|
||||
serde_json::json!({
|
||||
"responses_a": [{"op":"HeadObject", "case":"expires", "status":200, "header_names_sha256":"bade6835ceb831c4bf589348000369e2501eec559843403cf4e596baae5367d7"}],
|
||||
"responses_b": [{"op":"HeadObject", "case":"absent", "status":404, "header_names_sha256":"ef176135a5f329e2b96dace1cc94aaf3e2a172d89d99dd5c52ab12679b7383ba"}]
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_operation_list_is_sorted_without_duplicates() {
|
||||
assert!(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Programmable fake S3 target
|
||||
|
||||
This module is the shared failure-injection boundary for replication end-to-end tests and the programmable external source for on-demand-migration (ODM) tests. It runs an in-process, path-style S3 endpoint with the RustFS gateway and an in-memory store.
|
||||
This module is the shared failure-injection boundary for replication end-to-end tests and the programmable external source for on-demand-migration (ODM) tests. It runs an in-process, path-style S3 endpoint backed by `s3s`; no production crate depends on it.
|
||||
|
||||
`FakeS3Target::start()` creates the listener. Add target buckets with `create_bucket`, point a RustFS remote target at `address()`, use `FAKE_ACCESS_KEY` / `FAKE_SECRET_KEY`, then enqueue per-operation faults with `inject`. Faults for one operation are consumed in FIFO order and do not consume faults queued for another operation. A fault is consumed only after the gateway verifies the request signature, so anonymous, other-access-key, and bad-signature traffic cannot disturb a script.
|
||||
`FakeS3Target::start()` creates the listener. Add target buckets with `create_bucket`, point a RustFS remote target at `address()`, use `FAKE_ACCESS_KEY` / `FAKE_SECRET_KEY`, then enqueue per-operation faults with `inject`. Faults for one operation are consumed in FIFO order and do not consume faults queued for another operation. A fault is consumed only after `s3s` verifies the full request signature, so anonymous, other-access-key, and bad-signature traffic cannot disturb a script.
|
||||
|
||||
Supported data operations are HeadBucket, GetBucketVersioning, ListObjectsV2, PUT/GET/HEAD/DELETE Object, Get/Put/Delete ObjectTagging (tags live per version; Put replaces the whole set, Delete clears it), and create/upload/complete/abort multipart upload. `create_bucket` models general-purpose buckets in S3's shared global namespace; account-regional namespace buckets and their `-an` names are intentionally out of scope. Buckets created with `create_bucket` are versioned: PUT creates a version, DELETE without `versionId` creates a delete marker, and DELETE with `versionId` removes exactly that version. Internal source version IDs must be UUIDs and are stored canonically. Source mtime is honored only for source-replication PUT/DELETE requests; absent or invalid values use receipt time, matching RustFS, while multipart completion always uses receipt time. Replicated versions are ordered newest-first by source mtime so late older versions and delete markers do not become current. Equal mtimes prefer objects over delete markers, then canonical UUID order; RustFS's internal FileMeta signature tie-break is intentionally out of scope because it is not part of the target S3 protocol. Multipart part numbers follow S3's `1..=10000` range, and every completed part except the final part must be at least 5 MiB.
|
||||
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed 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.
|
||||
|
||||
use super::*;
|
||||
use rustfs_gateway::{ETag, ObjectKey, dto};
|
||||
|
||||
impl FakeBackend {
|
||||
pub(super) async fn head_bucket(
|
||||
&self,
|
||||
req: TargetRequest<dto::HeadBucketInput>,
|
||||
) -> S3Result<TargetResponse<dto::HeadBucketOutput>> {
|
||||
let fault = request_fault(&req);
|
||||
apply_non_body_fault(fault.as_ref(), &self.control).await?;
|
||||
if !lock(&self.store).buckets.contains_key(req.input.bucket.as_str()) {
|
||||
return Err(s3_error!(NoSuchBucket, "bucket does not exist"));
|
||||
}
|
||||
Ok(apply_response_fault(
|
||||
TargetResponse::new(dto::HeadBucketOutput::default()),
|
||||
fault.as_ref(),
|
||||
))
|
||||
}
|
||||
|
||||
pub(super) async fn get_bucket_versioning(
|
||||
&self,
|
||||
req: TargetRequest<dto::GetBucketVersioningInput>,
|
||||
) -> S3Result<TargetResponse<dto::GetBucketVersioningOutput>> {
|
||||
let fault = request_fault(&req);
|
||||
apply_non_body_fault(fault.as_ref(), &self.control).await?;
|
||||
let versioned = lock(&self.store)
|
||||
.buckets
|
||||
.get(req.input.bucket.as_str())
|
||||
.map(|bucket| bucket.versioned)
|
||||
.ok_or_else(|| s3_error!(NoSuchBucket, "bucket does not exist"))?;
|
||||
Ok(apply_response_fault(
|
||||
TargetResponse::new(dto::GetBucketVersioningOutput {
|
||||
status: versioned.then_some(dto::Status::ENABLED),
|
||||
..Default::default()
|
||||
}),
|
||||
fault.as_ref(),
|
||||
))
|
||||
}
|
||||
|
||||
pub(super) async fn get_object_lock_configuration(
|
||||
&self,
|
||||
req: TargetRequest<dto::GetObjectLockConfigurationInput>,
|
||||
) -> S3Result<TargetResponse<dto::GetObjectLockConfigurationOutput>> {
|
||||
let fault = request_fault(&req);
|
||||
apply_non_body_fault(fault.as_ref(), &self.control).await?;
|
||||
let object_lock = lock(&self.store)
|
||||
.buckets
|
||||
.get(req.input.bucket.as_str())
|
||||
.map(|bucket| bucket.object_lock)
|
||||
.ok_or_else(|| s3_error!(NoSuchBucket, "bucket does not exist"))?;
|
||||
if !object_lock {
|
||||
return Err(s3_error!(
|
||||
ObjectLockConfigurationNotFoundError,
|
||||
"Object Lock configuration does not exist for this bucket"
|
||||
));
|
||||
}
|
||||
Ok(apply_response_fault(
|
||||
TargetResponse::new(dto::GetObjectLockConfigurationOutput {
|
||||
object_lock_configuration: Some(dto::ObjectLockConfiguration {
|
||||
object_lock_enabled: Some(dto::ObjectLockEnabled::ENABLED),
|
||||
..Default::default()
|
||||
}),
|
||||
}),
|
||||
fault.as_ref(),
|
||||
))
|
||||
}
|
||||
|
||||
/// Current versions only (a key whose newest version is a delete marker
|
||||
/// is hidden), keys in byte order, `delimiter` folding into common
|
||||
/// prefixes that count toward `max-keys`, and `start-after` /
|
||||
/// `continuation-token` cursors. `encoding-type` and `fetch-owner` are
|
||||
/// accepted but ignored.
|
||||
pub(super) async fn list_objects_v2(
|
||||
&self,
|
||||
req: TargetRequest<dto::ListObjectsV2Input>,
|
||||
) -> S3Result<TargetResponse<dto::ListObjectsV2Output>> {
|
||||
let fault = request_fault(&req);
|
||||
apply_non_body_fault(fault.as_ref(), &self.control).await?;
|
||||
let input = req.input;
|
||||
let prefix = input.prefix.unwrap_or_default();
|
||||
let delimiter = input.delimiter.as_deref().filter(|delimiter| !delimiter.is_empty());
|
||||
let max_keys = input.max_keys.unwrap_or(MAX_LIST_KEYS).clamp(0, MAX_LIST_KEYS);
|
||||
let resume_after = input
|
||||
.continuation_token
|
||||
.as_ref()
|
||||
.map(|token| decode_continuation_token(token.as_str()))
|
||||
.transpose()?;
|
||||
let mut cursors = Vec::with_capacity(2);
|
||||
if let Some(start_after) = input.start_after.as_deref() {
|
||||
cursors.push(ListCursor {
|
||||
after: start_after,
|
||||
skips_group: false,
|
||||
});
|
||||
}
|
||||
if let Some(resume_after) = resume_after.as_deref() {
|
||||
cursors.push(ListCursor {
|
||||
after: resume_after,
|
||||
skips_group: delimiter.is_some_and(|delimiter| resume_after.ends_with(delimiter)),
|
||||
});
|
||||
}
|
||||
let page = {
|
||||
let state = lock(&self.store);
|
||||
let bucket_state = state
|
||||
.buckets
|
||||
.get(input.bucket.as_str())
|
||||
.ok_or_else(|| s3_error!(NoSuchBucket, "bucket does not exist"))?;
|
||||
list_page(
|
||||
bucket_state,
|
||||
&prefix,
|
||||
delimiter,
|
||||
&cursors,
|
||||
usize::try_from(max_keys).map_err(S3Error::internal_error)?,
|
||||
)
|
||||
};
|
||||
let next_continuation_token = page
|
||||
.truncated
|
||||
.then(|| {
|
||||
page.entries
|
||||
.last()
|
||||
.map(|entry| encode_continuation_token(entry.name()).into())
|
||||
})
|
||||
.flatten();
|
||||
let key_count = i32::try_from(page.entries.len()).map_err(S3Error::internal_error)?;
|
||||
let mut contents = Vec::new();
|
||||
let mut common_prefixes = Vec::new();
|
||||
for entry in page.entries {
|
||||
match entry {
|
||||
ListEntry::Object {
|
||||
key,
|
||||
e_tag,
|
||||
last_modified,
|
||||
size,
|
||||
} => contents.push(dto::Object {
|
||||
key: ObjectKey::new(key).map_err(S3Error::internal_error)?,
|
||||
e_tag: Some(ETag::from_stored(e_tag)),
|
||||
last_modified,
|
||||
size: i64::try_from(size).map_err(S3Error::internal_error)?,
|
||||
storage_class: dto::StorageClass::STANDARD,
|
||||
..Default::default()
|
||||
}),
|
||||
ListEntry::CommonPrefix(prefix) => common_prefixes.push(dto::CommonPrefix { prefix }),
|
||||
}
|
||||
}
|
||||
Ok(apply_response_fault(
|
||||
TargetResponse::new(dto::ListObjectsV2Output {
|
||||
name: input.bucket,
|
||||
prefix,
|
||||
delimiter: input.delimiter,
|
||||
max_keys,
|
||||
key_count,
|
||||
continuation_token: input.continuation_token,
|
||||
start_after: input.start_after,
|
||||
encoding_type: input.encoding_type,
|
||||
is_truncated: page.truncated,
|
||||
next_continuation_token,
|
||||
contents,
|
||||
common_prefixes,
|
||||
..Default::default()
|
||||
}),
|
||||
fault.as_ref(),
|
||||
))
|
||||
}
|
||||
|
||||
/// Prefix + max-keys subset only — enough for the replication-check probe
|
||||
/// key allocation. No pagination markers or delimiter folding.
|
||||
pub(super) async fn list_object_versions(
|
||||
&self,
|
||||
req: TargetRequest<dto::ListObjectVersionsInput>,
|
||||
) -> S3Result<TargetResponse<dto::ListObjectVersionsOutput>> {
|
||||
let fault = request_fault(&req);
|
||||
apply_non_body_fault(fault.as_ref(), &self.control).await?;
|
||||
let state = lock(&self.store);
|
||||
let Some(bucket_state) = state.buckets.get(req.input.bucket.as_str()) else {
|
||||
return Err(s3_error!(NoSuchBucket, "bucket does not exist"));
|
||||
};
|
||||
let prefix = req.input.prefix.as_deref().unwrap_or_default();
|
||||
let max_keys = usize::try_from(req.input.max_keys.unwrap_or(MAX_LIST_KEYS).max(0)).map_err(S3Error::internal_error)?;
|
||||
|
||||
let mut keys: Vec<&String> = bucket_state.objects.keys().filter(|key| key.starts_with(prefix)).collect();
|
||||
keys.sort();
|
||||
|
||||
let mut versions = Vec::new();
|
||||
let mut delete_markers = Vec::new();
|
||||
'keys: for key in keys {
|
||||
for version in bucket_state.objects[key].iter().rev() {
|
||||
if versions.len() + delete_markers.len() >= max_keys {
|
||||
break 'keys;
|
||||
}
|
||||
if version.delete_marker {
|
||||
delete_markers.push(dto::DeleteMarkerEntry {
|
||||
key: ObjectKey::new(key.clone()).map_err(S3Error::internal_error)?,
|
||||
version_id: version.version_id.clone().into(),
|
||||
last_modified: version.last_modified,
|
||||
..Default::default()
|
||||
});
|
||||
} else {
|
||||
versions.push(dto::ObjectVersion {
|
||||
key: ObjectKey::new(key.clone()).map_err(S3Error::internal_error)?,
|
||||
version_id: version.version_id.clone().into(),
|
||||
last_modified: version.last_modified,
|
||||
e_tag: Some(ETag::from_stored(version.e_tag.clone())),
|
||||
size: i64::try_from(version.body.len()).map_err(S3Error::internal_error)?,
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
drop(state);
|
||||
|
||||
Ok(apply_response_fault(
|
||||
TargetResponse::new(dto::ListObjectVersionsOutput {
|
||||
name: req.input.bucket,
|
||||
versions,
|
||||
delete_markers,
|
||||
..Default::default()
|
||||
}),
|
||||
fault.as_ref(),
|
||||
))
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user