-
Notifications
You must be signed in to change notification settings - Fork 70
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
Use with replica sets #132
Comments
Has this been confirmed? |
Thanks for reporting this. Mentioned issue is fixed with below commit. `commit 8ce1225
Also I have verified replica_set option with 2 mongo servers and it is working as expected. below is some use cases which I verified with replica_set `Connect to Secondary Mongo Server and Perform select & DML. only select should pass as Secondary is read only. edb=# create server ms foreign data wrapper mongo_fdw options (address 'localhost', port '27018'); edb=# insert into ft2 values ('2','Insert via FDW in Secondary'); Now connect to Secondary using replica_set option, as per ReadMe description DML should also pass now since using replica_set this will connect to Primary Server and run DML there. edb=# create server msr foreign data wrapper mongo_fdw options (address 'localhost', port '27018', replica_set 'mongoreplication'); edb=# insert into ft3 values ('2','Insert via FDW in Secondary via replica_set'); |
Curious if anyone has been able to use mongo_fdw with a replica set and a list of seed servers, and if there's a place where connection error log messages are being written that I'm just not seeing.
With no
replica_set
, if I set a single hostaddress
option inCREATE SERVER
, and the host isn't reachable, a simpleSELECT * FROM ...
silently returns 0 results after about 500 ms, and there are no error messages written to postgres stdout or stderr.With no
replica_set
, if I set a comma-separated hostaddress
option, and the first host is invalid but the second host is reachable, aSELECT * FROM ...
works, after about a 500 ms delay, as I'd probably expect.With a
replica_set
, regardless of theaddress
option, whether it has one host or multiple hosts, I get 0 results after about 500 ms.So it looks like
replica_set
doesn't work at all, and also connection errors result in silently returning no data rather than a hard failure.I'm using PostgreSQL 12.0 and mongo_fdw 5.2.6 compiled with
--with-master
. I've compiled it into a container based on the standard Docker Hubpostgres
image, so I'm wondering if that messes up the logging somehow.The text was updated successfully, but these errors were encountered: