@earth-app/collegedb
    Preparing search index...

    Function reconcileAllocations

    • Compares the coordinator's allocation ledger with routing metadata: the KV mapping, or the computed owner when a key has no mapping. Observational by default and off the read path.

      With verifyRecords, each row is also probed for its primary key on the routed shard (the ledger shard when a key has no mapping). A row that exists does not prove it is the authoritative copy. A shard holding a tombstone can keep a retained row, and the journal is the authority for moved keys. Disagreements are reported and never resolved.

      repair writes a KV mapping for keys that have none, and it needs verifyRecords. pruneVerified removes ledger rows that agree with routing and have an explicit mapping.

      Parameters

      • options: ReconcileOptions = {}

        Page size, write flags, record probes and an abort signal

      Returns Promise<ReconcileReport>

      Promise resolving to the reconciliation report

      COORDINATOR_NOT_CONFIGURED when no coordinator is configured

      RECONCILE_VERIFY_REQUIRED when repair is set without verifyRecords

      INVALID_IDENTIFIER when a listed table or key column is not a bare identifier

      1.4.0

      const report = await reconcileAllocations({
      pruneVerified: true,
      verifyRecords: { tables: [{ table: 'users' }] }
      });
      console.log(report.routingAgreed, report.recordMissingCount);