Repository navigation
docs: add ADR for a transactional outbox in the data sinks - #288
andrey-canon wants to merge 3 commits into
Conversation
Propose replacing the per-change Celery tasks of every data sink with an outbox table written in the same transaction as the platform change and a management command that sends it to ClickHouse in batches, run periodically by the infrastructure. Record the per-sink rules (courses, pathway deletions, user retirement), the failure handling, the admin, the rollout setting and the rejected alternatives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turning off the learner profile and external identifier sinks stops their outbox rows; the outbox only stores ids. Profile and external id rows sent outside the retirement order are deleted without being sent when the user is already retired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the pull request, @andrey-canon! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
@bmtcril the changes tested while writing this ADR are in this branch: https://github.com/eduNEXT/platform-plugin-aspects/tree/and/poc-enrollment-outbox It is a proof of concept for the course enrollment data sink only. It is not meant to be merged. What it includes
Nothing sends the outbox automatically in this branch. Running the command periodically belongs to the infrastructure and would come from tutor-contrib-aspects. To send the outbox while testing, run the command or use the Send now admin action. How to test it
|
Describe the savepoint around the outbox insert, how course publishes and user retirements are backed by MySQL, where serialization runs and what it locks, the database consequences (high-churn table, primary database, read bursts) and the admin's Send now overlapping the command. Replace the list of unrelated existing problems with the scope of the decision, and lead the CDC rejection with the data it cannot produce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
Adds ADR 0002, which proposes a transactional outbox for the data sinks.
Today every change to a record that Aspects copies to ClickHouse queues its own Celery task. That means one insert per change, work on the platform's shared workers, and changes that are lost when a task fails or is stopped. The ADR proposes that the signal receivers write a small row into an outbox table in the same transaction as the change, and that a management command sends the outbox to ClickHouse in batches.
The ADR covers:
drain_outbox_to_clickhousecommand and how to schedule it in Tutor;A proof of concept for the course enrollment data sink was built to validate the approach; it is not part of this PR.
Testing instructions
Documentation only. Build the docs (
make docs) and readdocs/decisions/0002-transactional-outbox-for-data-sinks.rst.Merge checklist:
Check off if complete or not applicable:
Conventional Commits type — they determine the
release:
fix:→ patch,feat:→ minor,!/BREAKING CHANGE:→ major🤖 Generated with Claude Code