mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-23 12:49:04 +00:00
feat(connect): emit durable heartbeats
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
},
|
||||
{
|
||||
"name": "heartbeat",
|
||||
"status": "reserved",
|
||||
"status": "populated",
|
||||
"purpose": "Heartbeat payloads, Connect receive time, and freshness window behavior."
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
975c1ca53eefeef6766a6fc0b3d3281f7408255342b0686e5e2aee5ad055414c duplicate.json
|
||||
963529a38a02849c6c2acc6d72668dca9f63218b49c89fae41a451b584850411 overflow.json
|
||||
e3adeee1c8a19aa17e70894896fb79c072e3785bea3611b93c11e79f039ed5af stale.json
|
||||
35b9cebd8525389a701e8fe69fbe96407bcb31aa28392fe95babf4a4886985ad unknown.json
|
||||
37941735dbd6ad3d238258a7b2cae6f0b3aa0ecaae1d8817817c3d718d11d633 valid.json
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"protocolVersion": "v1",
|
||||
"fixtureSet": "heartbeat",
|
||||
"fixture": "duplicate",
|
||||
"description": "An exact requestId replay returns the first result and creates no second heartbeat.",
|
||||
"first": {"requestId": "550e8400-e29b-41d4-a716-446655440000", "sequence": 42},
|
||||
"replay": {"requestId": "550e8400-e29b-41d4-a716-446655440000", "sequence": 42},
|
||||
"expected": {"decision": "DUPLICATE", "heartbeatWrites": 1, "events": 1, "sameResponse": true}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"protocolVersion": "v1",
|
||||
"fixtureSet": "heartbeat",
|
||||
"fixture": "overflow",
|
||||
"description": "Values beyond frozen bounds are rejected before persistence.",
|
||||
"vectors": [
|
||||
{"field": "sequence", "value": 9007199254740992, "maximum": 9007199254740991},
|
||||
{"field": "coarseNodeSummary.total", "value": 4097, "maximum": 4096}
|
||||
],
|
||||
"expected": {"decision": "REJECT", "httpStatus": 422, "status": "INVALID_ARGUMENT"}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"protocolVersion": "v1",
|
||||
"fixtureSet": "heartbeat",
|
||||
"fixture": "stale",
|
||||
"description": "A lower heartbeat sequence is retained as history and cannot replace the current projection.",
|
||||
"head": {"requestId": "550e8400-e29b-41d4-a716-446655440000", "sequence": 42},
|
||||
"late": {"requestId": "7c4d2e10-9f83-4a5b-b6c7-d8e9f0a1b2c3", "sequence": 9},
|
||||
"expected": {"decision": "ACCEPT_HISTORY", "currentSequence": 42, "historySequence": 9}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"protocolVersion": "v1",
|
||||
"fixtureSet": "heartbeat",
|
||||
"fixture": "unknown",
|
||||
"description": "Unknown optional members and capabilities are accepted, discarded before hashing, and never stored or echoed.",
|
||||
"requestAdditions": {
|
||||
"telemetryProfile": "extended",
|
||||
"authorization": "Bearer non-functional-example",
|
||||
"capabilities": ["heartbeat", "future.capability"],
|
||||
"coarseNodeSummary": {"rackNames": ["customer-rack"]}
|
||||
},
|
||||
"expected": {
|
||||
"decision": "ACCEPT",
|
||||
"storedCapabilities": ["heartbeat"],
|
||||
"discarded": ["authorization", "future.capability", "telemetryProfile", "coarseNodeSummary.rackNames"],
|
||||
"echoed": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"protocolVersion": "v1",
|
||||
"fixtureSet": "heartbeat",
|
||||
"fixture": "valid",
|
||||
"description": "A bounded L0 heartbeat. clientTime is advisory; Connect's receivedAt is online authority.",
|
||||
"request": {
|
||||
"protocolVersion": "v1",
|
||||
"requestId": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"agentVersion": "rustfs-agent/1.19.4",
|
||||
"capabilities": ["heartbeat", "inventory"],
|
||||
"sequence": 42,
|
||||
"clientTime": "2026-08-22T01:02:03Z",
|
||||
"coarseNodeSummary": {"total": 8, "healthy": 7, "degraded": 1}
|
||||
},
|
||||
"expected": {
|
||||
"decision": "ACCEPT",
|
||||
"acceptedVersion": "v1",
|
||||
"responseFields": ["serverTime", "acceptedVersion", "capabilityHints"],
|
||||
"onlineAuthority": "serverTime"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user