satellite/satellitedb/dbx: document audit tables

Change-Id: Iae0f2d7eaddb30cf43a3a7cd678f1dcfb8256a45
This commit is contained in:
Egon Elbre 2023-02-23 15:04:25 +02:00
parent 8befcaab27
commit 1f439f5ae9

View File

@ -1,24 +1,36 @@
//--- auditing ---//
// verification_audits contains a queue of segments to verify.
model verification_audits (
key inserted_at stream_id position
// inserted_at when the segment was queued for verification.
field inserted_at timestamp ( default current_timestamp )
// stream_id refers to the metabase segments.stream_id.
field stream_id blob
// position refers to the metabase segments.position.
field position uint64
// expires_at is set to the segment's expiration timestamp, if there is one.
field expires_at timestamp (nullable)
// encrypted_size is the size of the segment pre-expansion.
field encrypted_size int
)
// reverification_audits copntains a queue of segments where verification failed due to a timeout.
model reverification_audits (
key node_id stream_id position
// node_id is the node that timed out on verification.
field node_id blob
// stream_id refers to the metabase segments.stream_id.
field stream_id blob
// position refers to the metabase segments.position.
field position uint64
// piece_num is the piece index that the storage node stores.
field piece_num int
// inserted_at is the time the reverification was queued.
field inserted_at timestamp ( default current_timestamp )
// last_attempt is the last time the reverification was attempted.
field last_attempt timestamp ( updatable, nullable )
// reverify_count is the number of times the reverification has been attempted, but failed.
field reverify_count int64 ( updatable, default 0 )
index ( fields inserted_at )
@ -38,17 +50,25 @@ delete reverification_audits (
where reverification_audits.position = ?
)
//--- containment ---//
// segment_pending_audits contains list of segments that need to be audited.
// This table is deprecated, it was replaced by reverification_audits.
model segment_pending_audits (
key node_id
// node_id is the node that should be audited.
field node_id blob
// stream_id refers to the metabase segments.stream_id.
field stream_id blob
// position refers to the metabase segments.position.
field position uint64
// is the derived piece id that the storagenode is storing.
field piece_id blob
// stripe_index is the stripe we are trying to audit.
field stripe_index int64
// share_size is the size of the share.
field share_size int64
// expected_share_hash is the hash that we should get as the audit result.
field expected_share_hash blob
// reverify_count is the number of times the audit has been attempted.
field reverify_count int64 ( updatable )
)