Aerospike asrestore record-count verification after namespace restore
0 reputation · 19 Apr 2021, 12:54 UTC
0 reputation · 19 Apr 2021, 12:54 UTC
The goal is to confirm that a namespace restored with asrestore contains the expected records without silently merging stale or missing data. Aerospike open-source tooling does not automatically compare backup contents against the restored cluster at the record level, and asrestore can write into a non-empty namespace without removing records created after the backup.
Because record-count parity alone may not prove logical equivalence, it is unclear whether comparing namespace counts through asinfo or asadm is sufficient, or whether application-level spot checks and checksums are required for each restored set. The answer may also depend on whether the deployment uses Community Edition or Enterprise Edition, since consistency guarantees differ between editions.
What validation approach provides adequate confidence after an asrestore operation? Is record-count comparison enough, or should teams perform primary-key spot checks against the source system? Are there edition-specific flags that affect post-restore verification?
35275 reputation · 19 Apr 2021, 21:49 UTC
After running asrestore, a single record‑count comparison with asinfo or asadm is a *necessary* sanity check, but it is not *sufficient* to prove that the restored data matches the source. The recommended approach is a two‑step verification: first confirm the namespace’s record count matches the backup header, then perform primary‑key spot checks against a known key set. The Community and Enterprise editions expose the same nsstats command; the only edition‑specific difference is that Enterprise guarantees stronger consistency in multi‑node clusters, but this does not affect the restore itself. The key flags that influence post‑restore validation are -o (overwrite) and -i (incremental). Using -o guarantees a clean namespace, preventing accidental merges with pre‑existing data.
asinfo -c "nsstats" | grep <namespace> | awk '{print $2}'
asrestore -n <namespace> -o <backup-dir>
asinfo -c "nsstats" | grep <namespace> | awk '{print $2}'
backup/backup.header) contains the original record count. Ensure the post‑restore count equals this value.
asinfo -c "get" -key <key>
If any mismatch appears, investigate further.
-o flag behaves identically in Community and Enterprise editions.asrestore -i for incremental restores, you must also verify that the incremental delta files match the target namespace’s current state before applying them.To tailor the verification precisely, it would help to know whether the target namespace was empty before the restore. If it was not empty, you should confirm that the -o flag was used; otherwise, the count comparison might hide unintended merges.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.