Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add locking in cleanup #23

Merged
merged 5 commits into from
Jun 19, 2024
Merged

feat: add locking in cleanup #23

merged 5 commits into from
Jun 19, 2024

Conversation

chris-asl
Copy link
Collaborator

@chris-asl chris-asl commented Jun 11, 2024

Continuation of the outbox items cleanup epic. As per our spike, we've introduced a separate locks provider for cleanup. Please refer to the commit message for the rationale behind this.

Resolves [VR-3403].

@chris-asl chris-asl requested review from ippokratoys and GregBal June 11, 2024 08:56
@chris-asl chris-asl self-assigned this Jun 11, 2024
@chris-asl chris-asl force-pushed the feat/add-locking-in-cleanup branch 4 times, most recently from d1de85a to 649f6fc Compare June 14, 2024 09:23
Copy link
Collaborator

@GregBal GregBal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

core/build.gradle.kts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@chris-asl chris-asl force-pushed the feat/add-locking-in-cleanup branch 3 times, most recently from 810de71 to b9dea5a Compare June 17, 2024 12:47
@@ -27,7 +27,7 @@ Transactional Outbox is published on `mavenCentral`. In order to use it just add

```gradle

implementation("io.github.bluegroundltd:transactional-outbox-core:1.0.0")
implementation("io.github.bluegroundltd:transactional-outbox-core:2.0.0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add some notes on how users should upgrade from 1.0.0 to 2.0.0?
Or we should add this to the release tag after the release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's a nice idea!

In this case though, the upgrade only requires the addition of the locks provider call and the rename of the current function. The TransactionalBuilder API is guiding the user via the fluent interface. I've also kinda updated the docs here.

Do you possibly mean adding a migration guide? Like

Upgrading from 1.x to 2.0.0

?

Copy link
Collaborator Author

@chris-asl chris-asl Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9d4d65e 👀

Despite the fact that the store implementation could simply issue a
`DELETE FROM outbox_item WHERE delete_after < now`
it could also, fetch the to be deleted items and then try to delete
them, which when run concurrently (w/o locks) could end up with
errors. Thus, to be safe, we're introducing locks in cleanup, as well.

We could use the same locks provider we're using for monitor, but that
would serialize the monitor and cleanup runs, which is not required.

[VR-3403]
@chris-asl chris-asl force-pushed the feat/add-locking-in-cleanup branch 2 times, most recently from cc3d366 to 16980d8 Compare June 18, 2024 16:09
A breaking change since we change the interface of
`TransactionalOutboxBuilder`.

[VR-3403]
@chris-asl chris-asl force-pushed the feat/add-locking-in-cleanup branch from 16980d8 to fba98cb Compare June 19, 2024 08:30
@chris-asl chris-asl merged commit cb983f7 into main Jun 19, 2024
1 check passed
@chris-asl chris-asl deleted the feat/add-locking-in-cleanup branch June 19, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants