-
Notifications
You must be signed in to change notification settings - Fork 476
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
"SELECT FOR UPDATE" is needed for PostgreSQL #3039
Comments
@azdagron This behavior was introduced in #2605 to fix #2587. As @yangmarcyang points, data consistency checks have special considerations in PostgreSQL when hot standby mode is turned on. May we able to detect when this mode is turned on and have |
@amartinezfayo I think we can tell if psql is in hot standby mode by |
I don't see a problem just enabling SELECT FOR UPDATE on all read-modify-write tx's for both MySQL and PostgreSQL. |
This is required to successfully perform read-modify-write operations when PostgreSQL is in hot standby mode. Fixes: spiffe#3039 Signed-off-by: Andrew Harding <aharding@vmware.com>
This is required to successfully perform read-modify-write operations when PostgreSQL is in hot standby mode. Fixes: #3039 Signed-off-by: Andrew Harding <aharding@vmware.com>
This is required to successfully perform read-modify-write operations when PostgreSQL is in hot standby mode. Fixes: spiffe#3039 Signed-off-by: Andrew Harding <aharding@vmware.com>
Hi All,
In #2770, we encountered "extreme cases" where a JWT key exists in local journal.pem but does not exist in DB bundle table. Recently the issue happened again in our setup where a spire-server generated a new key, stored in DB bundle table without any error, saved into local journal.pem file, but unfortunately that key did not exist in DB bundle table.
After we set up testing environment and could reproduce the issue consistently, we found that the root cause is related with PostgreSQL hot standby mode. In our setup, hot standby mode is turned on, and according to the spec, "those using hot standby may want to use Repeatable Read and explicit locking on the master". So, "SELECT FOR UPDATE" is needed in this case.
We just simply copied this line out of the if block and ran it in the testing environment, the issue became non-reproducible.
So, to have consistency guarantees for PostgreSQL with hot standby mode, IMHO "SELECT FOR UPDATE" is still needed.
The text was updated successfully, but these errors were encountered: