Skip to content

chore: create and execute QLDB document migration to backfill entryId field #112

@MaximumTrainer

Description

@MaximumTrainer

Background

AwsQldbLedger.kt contains a fallback code path that reads metaId when entryId is not present on a document. The fallback exists because older documents were written before the entryId field was introduced.

The fallback can be removed once ALL existing QLDB documents have been backfilled with an entryId value.

Tasks

  • Audit the QLDB ledger to count documents missing entryId:
    SELECT COUNT(*) FROM audit_events WHERE entryId IS MISSING
  • Write a backfill script that sets entryId = metaId for all documents where entryId is missing
  • Run the backfill script in staging, verify 0 documents missing entryId
  • Run the backfill script in production
  • Remove the metaId fallback branch from AwsQldbLedger.kt
  • Remove the metaId field if no longer needed

Completion criteria

The fallback can be removed when SELECT COUNT(*) FROM audit_events WHERE entryId IS MISSING returns 0 in production.

Files

  • backend/src/main/kotlin/com/factstore/adapter/outbound/AwsQldbLedger.kt (~line 159)

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions