The process reads its broker account, answers the seat mesh-recovery's verbs itself with the caller the bus proved, takes and restores streams through mesh-sdk's bussnap, keeps the digests in its state, names a kept data's bus objects from its catalog entry as mesh-sdk names them, learns the fingerprint a module runs at from the node-engine seat's running and the bus module's dumps from the backup holders' item events, each read whole at its start, and asks the backup holder on its node to bring the points directory back. A restore whose restore-started the bus did not acknowledge reads and sets aside nothing. Builds: design 47 G §554, §516, §551, §556, §563, §567, §655, A-107, A-112, A-121, A-123, A-126, A-132 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
269 lines
6.9 KiB
JSON
269 lines
6.9 KiB
JSON
{
|
|
"module": "mesh-recovery",
|
|
"version": "0.1",
|
|
"runs-as": "mesh-recovery",
|
|
"claims": [
|
|
{
|
|
"name": "mesh-recovery",
|
|
"scope": "mesh",
|
|
"serves": [
|
|
"snapshot-kept",
|
|
"restore-kept",
|
|
"kept-points",
|
|
"restore-aside",
|
|
"cancel",
|
|
"take",
|
|
"restore",
|
|
"retry",
|
|
"aside",
|
|
"discard-aside",
|
|
"expire-points"
|
|
]
|
|
}
|
|
],
|
|
"tools": [
|
|
"recovery_kept_points",
|
|
"recovery_take",
|
|
"recovery_restore",
|
|
"recovery_retry",
|
|
"recovery_aside",
|
|
"recovery_discard_aside",
|
|
"recovery_restore_aside",
|
|
"recovery_cancel",
|
|
"recovery_expire_points"
|
|
],
|
|
"consumes": [
|
|
"node-backup.item-started",
|
|
"node-backup.item-ended",
|
|
"node-engine.running",
|
|
"mesh-broker.snapshot-restored",
|
|
"mesh-conditions.findings-asked"
|
|
],
|
|
"invokes": [
|
|
"seat:mesh-catalog.entry",
|
|
"seat:mesh-module-assigner.assignments",
|
|
"seat:mesh-hand-acts.hand-act",
|
|
"seat:mesh-broker.snapshot-get",
|
|
"seat:mesh-broker.snapshot-restore",
|
|
"seat:node-backup.restore",
|
|
"seat:mesh-recovery.kept-points",
|
|
"seat:mesh-recovery.restore-aside",
|
|
"seat:mesh-recovery.cancel",
|
|
"seat:mesh-recovery.take",
|
|
"seat:mesh-recovery.restore",
|
|
"seat:mesh-recovery.retry",
|
|
"seat:mesh-recovery.aside",
|
|
"seat:mesh-recovery.discard-aside",
|
|
"seat:mesh-recovery.expire-points"
|
|
],
|
|
"requires": [
|
|
{
|
|
"name": "digests",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"max-mib": 4
|
|
}
|
|
},
|
|
{
|
|
"name": "findings",
|
|
"storage": "key-value",
|
|
"template": "state"
|
|
},
|
|
{
|
|
"name": "finding-events",
|
|
"storage": "stream",
|
|
"template": "events",
|
|
"options": {
|
|
"events": [
|
|
"finding-written.*",
|
|
"finding-cleared.*",
|
|
"findings-stated.*"
|
|
],
|
|
"max-age-days": 7,
|
|
"max-mib": 16
|
|
}
|
|
}
|
|
],
|
|
"config": {
|
|
"points-cap": {
|
|
"type": "number",
|
|
"description": "bytes the points directory may hold; an act that would pass it ends failed, naming it, before it removes anything (design 47 G section 564).",
|
|
"minimum": 1,
|
|
"trusted": false,
|
|
"default": 10737418240
|
|
},
|
|
"points-filling-mark": {
|
|
"type": "number",
|
|
"description": "percent of the cap past which the finding points-filling is written (design 47 G section 564).",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"trusted": false,
|
|
"default": 80
|
|
},
|
|
"point-keep-days": {
|
|
"type": "number",
|
|
"description": "days after which a restore point is removed, the newest of its kept data never (design 47 G sections 551, 557).",
|
|
"minimum": 1,
|
|
"maximum": 3650,
|
|
"trusted": false,
|
|
"default": 90
|
|
},
|
|
"dump-wait-minutes": {
|
|
"type": "number",
|
|
"description": "minutes an act waits on the dump of the bus's item before recovery-waits is written (design 47 G sections 561, 557).",
|
|
"minimum": 1,
|
|
"maximum": 10080,
|
|
"trusted": false,
|
|
"default": 60
|
|
}
|
|
},
|
|
"data": {
|
|
"own": [
|
|
{
|
|
"id": "points",
|
|
"path": "${dir:points}",
|
|
"class": "valuable",
|
|
"why": "the restore points taken of modules' kept data before a form change, and the asides of live data set aside before a restore (design 47 G sections 516, 554)"
|
|
}
|
|
]
|
|
},
|
|
"own-secrets": {
|
|
"broker": "${dir:state}/broker"
|
|
},
|
|
"secrets-owner": "mesh-recovery",
|
|
"resources": [
|
|
{
|
|
"id": "account",
|
|
"type": "user",
|
|
"name": "mesh-recovery",
|
|
"shell": "/usr/bin/nologin",
|
|
"home": "/var/lib/mesh-recovery"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "mesh-recovery",
|
|
"place": ".",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "points",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh-recovery/points",
|
|
"mode": "0700",
|
|
"owner": "mesh-recovery",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "cap",
|
|
"type": "file",
|
|
"path": "${dir:state}/points-cap",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"content": "${config:points-cap}"
|
|
},
|
|
{
|
|
"id": "mark",
|
|
"type": "file",
|
|
"path": "${dir:state}/points-filling-mark",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"content": "${config:points-filling-mark}"
|
|
},
|
|
{
|
|
"id": "keep-days",
|
|
"type": "file",
|
|
"path": "${dir:state}/point-keep-days",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"content": "${config:point-keep-days}"
|
|
},
|
|
{
|
|
"id": "dump-wait",
|
|
"type": "file",
|
|
"path": "${dir:state}/dump-wait-minutes",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"content": "${config:dump-wait-minutes}"
|
|
},
|
|
{
|
|
"id": "recovery",
|
|
"type": "process",
|
|
"name": "mesh-recovery",
|
|
"artifact": "program",
|
|
"run": [
|
|
"./mesh-recovery"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "${dir:state}/broker",
|
|
"MESH_RECOVERY_POINTS": "${dir:points}",
|
|
"MESH_RECOVERY_POINTS_CAP_FILE": "${dir:state}/points-cap",
|
|
"MESH_RECOVERY_FILLING_MARK_FILE": "${dir:state}/points-filling-mark",
|
|
"MESH_RECOVERY_KEEP_DAYS_FILE": "${dir:state}/point-keep-days",
|
|
"MESH_RECOVERY_DUMP_WAIT_FILE": "${dir:state}/dump-wait-minutes"
|
|
},
|
|
"user": "mesh-recovery",
|
|
"serves": [
|
|
"seat:mesh-recovery.snapshot-kept",
|
|
"seat:mesh-recovery.restore-kept",
|
|
"seat:mesh-recovery.kept-points",
|
|
"seat:mesh-recovery.restore-aside",
|
|
"seat:mesh-recovery.cancel",
|
|
"seat:mesh-recovery.take",
|
|
"seat:mesh-recovery.restore",
|
|
"seat:mesh-recovery.retry",
|
|
"seat:mesh-recovery.aside",
|
|
"seat:mesh-recovery.discard-aside",
|
|
"seat:mesh-recovery.expire-points"
|
|
],
|
|
"bus": {
|
|
"state": [
|
|
"digests",
|
|
"findings"
|
|
],
|
|
"invokes": [
|
|
"seat:mesh-catalog.entry",
|
|
"seat:mesh-module-assigner.assignments",
|
|
"seat:mesh-hand-acts.hand-act",
|
|
"seat:mesh-broker.snapshot-get",
|
|
"seat:mesh-broker.snapshot-restore",
|
|
"seat:node-backup.restore"
|
|
]
|
|
},
|
|
"health": {
|
|
"kind": "tool",
|
|
"tool": "recovery_kept_points",
|
|
"interval": "60s",
|
|
"timeout": "10s",
|
|
"looks": 2,
|
|
"grace": "180s"
|
|
}
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "program",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/mesh-recovery",
|
|
"binary": "mesh-recovery"
|
|
},
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/mesh-recovery-tools",
|
|
"binary": "mesh-recovery-tools",
|
|
"loads": [
|
|
"mesh-recovery-tools"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|