chibenwa commented on code in PR #3213:
URL: https://github.com/apache/james-project/pull/3213#discussion_r4132571891
##########
server/mailrepository/mailrepository-blob/src/main/scala/org/apache/james/mailrepository/blob/BlobMailRepository.scala:
##########
@@ -169,35 +180,96 @@ class BlobMailRepository(val mailMetaDataBlobStore:
BlobStore,
.map(mailPartsId => mailPartsId.toMailKey)
.block()
+ oldMimeId.foreach(mimeId =>
+ SMono.fromPublisher(mimeMessageStore.delete(mimeId))
+ .retryWhen(Retry.backoff(2, Duration.ofMillis(50)))
+ .doOnError(e => LOGGER.warn("Failed to delete superseded MIME blobs {}
and {} for mail {} in {}",
+ mimeId.getHeaderBlobId.asString(), mimeId.getBodyBlobId.asString(),
mc.getName, url.asString(), e))
+ .onErrorResume(_ => SMono.empty)
+ .block()
+ )
Review Comment:
We should have IMO a plan for dropping those exta reads.
My proposition is to:
- Leave BlobMailRepository -> untouched but marked as **deprecated** and to
be removed after 3.10.0 release
- Have a BlobMailRepositoryV2 which do NOT handle retrocompatibility and
adopt whatever format is most suited
- Write a upgrade instruction saying that BlobMailRepository will be
dropped next release. That users can configure both `BlobMailRepository` and
`BlobMailRepositoryV2` playing mailrepositorystore.xml config and move messages
via webadmin. They shall do that prior 3.11.0.
Exact steps would be:
- A. add blobv2:// backed by BlobMailRepositoryV2 in mailrepositorystore.xml
- A. and Update mailet container to use blobv2://
- A. and reboot james
- B. move things from blob:// to blobv2:// cf webadmin API
- C: Set blob:// to be backed by BlobMailRepositoryV2
- C: and Update mailet container to use blob://
- C: and remove blobv2:// section
- C: and reboot
CF
https://james.staged.apache.org/james-project/3.10.0/servers/distributed/operate/webadmin.html#_moving_mails_from_a_mail_repository_to_another
I believe it provides a clear discontinuation plan with limited compexity on
our hand and limits retro compatibility concerns: our hands are free to make
optimal choices.
Opinion ?
--
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]