Skip to content

compose: Make pair_aggregator service stateless - #2630

Merged
divergentdave merged 1 commit into
mainfrom
david/compose-pair-aggregator-stateless
Oct 21, 2026
Merged

divergentdave merged 1 commit into
mainfrom
david/compose-pair-aggregator-stateless

Conversation

@divergentdave

Copy link
Copy Markdown
Collaborator

The change to the Docker Compose setup from #2552 introduces a different kind of failure mode. The pair_aggregator service uses a named volume, which persists after docker compose down, and is reattached the next time the environment is brought up. The Postgres service uses an ephemeral volume, which technically does persist, but isn't ever reused. As a result, it's possible to have an old volume with a /tmp/done file be used alongside a fresh database, leading to no initialization being done.

This PR takes a different approach, removing the /tmp/done file altogether instead of changing where it is stored. The pairing script now runs divviup aggregator list and checks if the expected helper aggregator is present, and then decides whether to create aggregators and an account based on the result.

@divergentdave
divergentdave requested a review from a team as a code owner October 21, 2026 14:05

@tgeoghegan tgeoghegan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems reasonable. But won't the aggregator ID assigned by divviup-api change? Perhaps that doesn't matter if everything else refers to the aggregator by API URL.

@divergentdave

Copy link
Copy Markdown
Collaborator Author

Yeah, the aggregator ID is generated randomly during setup. I don't think this PR changes that, I'm just trying to avoid creating duplicate accounts and aggregators, while also avoiding failing to create them at all in other situations.

@divergentdave
divergentdave merged commit 68af511 into main Oct 21, 2026
9 checks passed
@divergentdave
divergentdave deleted the david/compose-pair-aggregator-stateless branch October 21, 2026 15:24
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.

2 participants