HesandaLiyanage opened a new pull request, #3216:
URL: https://github.com/apache/james-project/pull/3216
### Proposed Changes
This PR provides PostgreSQL support for S3 Object Compaction by implementing
`PostgresBlobIdUpdater` and binding it in `PostgresMailboxModule`.
#### Context & Motivation
In #3193, `BlobIdUpdater` was introduced to decouple blob storage from
database reference updating during S3 object compaction. However, only
`CassandraBlobIdUpdater` was implemented, leaving S3 compaction unavailable for
PostgreSQL deployments.
This change brings PostgreSQL to feature parity:
- **`PostgresBlobIdUpdater`**:
- Scans both `message` (`body_blob_id`) and `attachment` (`blob_id`)
tables across all domains using paginated queries.
- Observes all live references and tracks candidate IDs matching the
target generation condition.
- Replaces references in safe batches (500 IDs per query) targeting
primary keys (`message_id` and `id`) with strict checks against existing blob
IDs.
- **`PostgresMailboxModule`**:
- Binds `BlobIdUpdater.Factory` to `PostgresBlobIdUpdater.Factory` in
singleton scope.
- **Test Suite**:
- Adds `PostgresBlobIdUpdaterTest` covering message body replacement,
attachment blob replacement, generation predicate filtering, and non-existent
reference idempotency against PostgreSQL testcontainers.
> **Note**: Depends on #3193 for the `BlobIdUpdater` SPI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]