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

Unsafe inter-thread communication with appliers #9990

Open
Gerold103 opened this issue May 3, 2024 · 0 comments
Open

Unsafe inter-thread communication with appliers #9990

Gerold103 opened this issue May 3, 2024 · 0 comments
Labels
bug Something isn't working replication

Comments

@Gerold103
Copy link
Collaborator

There is a not protected reading of non-atomic variables in tx thread which are changing in applier threads. The function applier_read_tx_row() changes applier->lag and applier->last_row_time in applier-thread, and then they are accessed in TX thread without any protection: applier_check_sync() touches applier->lag and lbox_pushapplier() touches applier->last_row_time.

There most likely are more of these misusages.

Given the applier's messy state, it could make sense to split it into 2 structs. One lives entirely in applier-threads, another lives in TX thread. Then the mistakes won't be so easily possible.

@Gerold103 Gerold103 added bug Something isn't working replication labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working replication
Projects
None yet
Development

No branches or pull requests

1 participant