4 ms·
Actually the way Wikipedia works is slightly different: they don't redirect to a lead database, they instead call this MySQL function to wait on the replica for
by simonw 5y ago
Actually the way Wikipedia works is slightly different: they don't redirect to a lead database, they instead call this MySQL function to wait on the replica for it to catch up:
SELECT WAIT_FOR_EXECUTED_GTID_SET($gtidArg, $timeout)
https://github.com/wikimedia/mediawiki/blob/434c333d9b2be81741e8b01d2e185a7c4ff5ed6e/includes/libs/rdbms/database/DatabaseMysqlBase.php https://github.com/wikimedia/mediawiki/blob/434c333d9b2be817...
I wonder if there's a PostgreSQL equivalent of this?
- simonw 5y agoLooks like someone proposed a WAIT FOR feature for PostgreSQL a couple of years ago: https://www.postgresql.org/message-id/flat/69a363498b76cd079ae19c4ee93bced0%40postgrespro.ru#3b4a7c8bbf942f3a39078fc0f1a5b2fd https://www.postgresql.org/message-id/flat/69a363498b76cd079...