s3_scrubber: implement scan-metadata for safekeepers.

It works by listing postgres table with memory dump of safekeepers state. s3
contents for each timeline are checked then against timeline_start_lsn and
backup_lsn. If inconsistency is found, before complaining timeline (branch) is
checked at control plane; it might have been deleted between the dump take and
s3 check.
This commit is contained in:
Arseny Sher
2024-04-03 15:46:54 +03:00
committed by Arseny Sher
parent 010f0a310a
commit 3da54e6d90
9 changed files with 363 additions and 37 deletions

View File

@@ -3734,7 +3734,9 @@ class S3Scrubber:
return stdout
def scan_metadata(self) -> Any:
stdout = self.scrubber_cli(["scan-metadata", "--json"], timeout=30)
stdout = self.scrubber_cli(
["scan-metadata", "--node-kind", "pageserver", "--json"], timeout=30
)
try:
return json.loads(stdout)