Skip to content

Don't create replUser on initial bootstrap#56

Merged
davissp14 merged 3 commits intomainfrom
fix-race-condition
Jan 14, 2022
Merged

Don't create replUser on initial bootstrap#56
davissp14 merged 3 commits intomainfrom
fix-race-condition

Conversation

@davissp14
Copy link
Contributor

@davissp14 davissp14 commented Jan 14, 2022

This PR works to address a fun race condition.

Stolon creates the replUser as part of the bootstrap process, and we work to create the replUser if it doesn't exist at boot time. If our logic runs before Stolon's, Stolon will fail because it doesn't properly check to see if the replUser exists before attempting to create it. The failure causes Stolon to re-bootstrap the cluster which ends up clearing out any users that are not the SU_USER or REPL_USER. So really just the OPERATOR_USER, which is postgres.

https://github.com/sorintlab/stolon/blob/057389f7e484ee1d5c1e1a7020256020e7413c87/internal/postgresql/postgresql.go#L580-L582

@davissp14 davissp14 merged commit db8b4a1 into main Jan 14, 2022
@dangra dangra deleted the fix-race-condition branch October 3, 2022 18:43
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.

1 participant