EnterpriseDB / mongo_fdw

PostgreSQL foreign data wrapper for MongoDB
GNU Lesser General Public License v3.0
330 stars 70 forks source link

Segfault on select #71

Closed RocketEnvy closed 7 years ago

RocketEnvy commented 7 years ago

Following the Readme.md everything seems to go okay until I actually try to do a select. There is nothing about it in the Mongo logs. Postgres log is:

==> postgresql/postgresql-9.5-main.log <==
2017-01-11 07:23:59 MST [14910-1] g@g ERROR:  relation "notes" does not exist at character 15
2017-01-11 07:23:59 MST [14910-2] g@g STATEMENT:  select * from notes;
2017-01-11 07:24:43 MST [2839-47] LOG:  server process (PID 14915) was terminated by signal 11: Segmentation fault
2017-01-11 07:24:43 MST [2839-48] DETAIL:  Failed process was running: select * from notes;
2017-01-11 07:24:43 MST [2839-49] LOG:  terminating any other active server processes
2017-01-11 07:24:43 MST [14759-2] WARNING:  terminating connection because of crash of another server process
2017-01-11 07:24:43 MST [14759-3] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2017-01-11 07:24:43 MST [14759-4] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2017-01-11 07:24:43 MST [14917-1] g@gtest FATAL:  the database system is in recovery mode
2017-01-11 07:24:43 MST [2839-50] LOG:  all server processes terminated; reinitializing
2017-01-11 07:24:43 MST [14918-1] LOG:  database system was interrupted; last known up at 2017-01-11 07:12:15 MST
2017-01-11 07:24:43 MST [14918-2] LOG:  database system was not properly shut down; automatic recovery in progress
2017-01-11 07:24:43 MST [14918-3] LOG:  invalid record length at 0/1AE05F8
2017-01-11 07:24:43 MST [14918-4] LOG:  redo is not required
2017-01-11 07:24:43 MST [14918-5] LOG:  MultiXact member wraparound protections are now enabled
2017-01-11 07:24:43 MST [2839-51] LOG:  database system is ready to accept connections
2017-01-11 07:24:43 MST [14922-1] LOG:  autovacuum launcher started
ahsanhadi commented 7 years ago

Are you building from the latest code from github? I was able to run these commands successfully..

On Wed, Jan 11, 2017 at 7:32 PM, RocketEnvy notifications@github.com wrote:

Following the Readme.md everything seems to go okay until I actually try to do a select. There is nothing about it in the Mongo logs. Postgres log is:

==> postgresql/postgresql-9.5-main.log <== 2017-01-11 07:23:59 MST [14910-1] g@g ERROR: relation "notes" does not exist at character 15 2017-01-11 07:23:59 MST [14910-2] g@g STATEMENT: select from notes; 2017-01-11 07:24:43 MST [2839-47] LOG: server process (PID 14915) was terminated by signal 11: Segmentation fault 2017-01-11 07:24:43 MST [2839-48] DETAIL: Failed process was running: select from notes; 2017-01-11 07:24:43 MST [2839-49] LOG: terminating any other active server processes 2017-01-11 07:24:43 MST [14759-2] WARNING: terminating connection because of crash of another server process 2017-01-11 07:24:43 MST [14759-3] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2017-01-11 07:24:43 MST [14759-4] HINT: In a moment you should be able to reconnect to the database and repeat your command. 2017-01-11 07:24:43 MST [14917-1] g@gtest FATAL: the database system is in recovery mode 2017-01-11 07:24:43 MST [2839-50] LOG: all server processes terminated; reinitializing 2017-01-11 07:24:43 MST [14918-1] LOG: database system was interrupted; last known up at 2017-01-11 07:12:15 MST 2017-01-11 07:24:43 MST [14918-2] LOG: database system was not properly shut down; automatic recovery in progress 2017-01-11 07:24:43 MST [14918-3] LOG: invalid record length at 0/1AE05F8 2017-01-11 07:24:43 MST [14918-4] LOG: redo is not required 2017-01-11 07:24:43 MST [14918-5] LOG: MultiXact member wraparound protections are now enabled 2017-01-11 07:24:43 MST [2839-51] LOG: database system is ready to accept connections 2017-01-11 07:24:43 MST [14922-1] LOG: autovacuum launcher started

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/issues/71, or mute the thread https://github.com/notifications/unsubscribe-auth/AHmqpAnSaAtTSln1AMwy1iVwbdGORKQ7ks5rROgHgaJpZM4LgpNd .

-- Ahsan Hadi Snr Director Product Development EnterpriseDB Corporation The Enterprise Postgres Company

Phone: +92-51-8358874 Mobile: +92-333-5162114

Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message.

RocketEnvy commented 7 years ago

Yes, I checked it out of github this morning.

ahsanhadi commented 7 years ago

On Wed, Jan 11, 2017 at 8:19 PM, RocketEnvy notifications@github.com wrote:

Yes, I checked it out of github this morning.

Okay will check it out tomorrow...You are using PG 9.5.x right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/issues/71#issuecomment-271895725, or mute the thread https://github.com/notifications/unsubscribe-auth/AHmqpJLWQ8r39Zsmshz1Hcgq9RENd3fVks5rRPL9gaJpZM4LgpNd .

-- Ahsan Hadi Snr Director Product Development EnterpriseDB Corporation The Enterprise Postgres Company

Phone: +92-51-8358874 Mobile: +92-333-5162114

Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message.

RocketEnvy commented 7 years ago

Yes, 9.5.x on Ubuntu Linux Marx 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Let me know if you need any more information.

RocketEnvy commented 7 years ago

I got this working by recompiling the mongo-c-driver with -fpic and -fPIC. Also told it -L/lib64. I don't know for which if anything actually got it working, afraid I wasn't very methodical. I'm not sure, but I think I missed that mongo-c-driver wasn't compiling and maybe the fdw was falling back on a system version?

ahsanhadi commented 7 years ago

On Thursday, 12 January 2017, RocketEnvy notifications@github.com wrote:

I got this working by recompiling the mongo-c-driver with -fpic and -fPIC. Also told it -L/lib64. I don't know for which if anything actually got it working, afraid I wasn't very methodical. I'm not sure, but I think I missed that mongo-c-driver wasn't compiling and maybe the fdw was falling back on a system version?

Thanks. I also suspected that you were using an older version of the driver since i had it working fine with both 95 and 96.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EnterpriseDB/mongo_fdw/issues/71#issuecomment-272077646, or mute the thread https://github.com/notifications/unsubscribe-auth/AHmqpBHIa9Z6B5B8BtFx_iTfIZR1yIeNks5rRbXKgaJpZM4LgpNd .

-- Ahsan Hadi Snr Director Product Development EnterpriseDB Corporation The Enterprise Postgres Company

Phone: +92-51-8358874 Mobile: +92-333-5162114

Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message.