vidardb / pgrocks-fdw

Bring RocksDB to PostgreSQL as an extension. It is the first foreign data wrapper (FDW) that introduces LSM-tree into PostgreSQL. The underneath storage engine can be RocksDB. The FDW also serves for VidarDB engine, a versatile storage engine for various workloads. See the link for more info about VidarDB engine.
https://www.vidardb.com
Apache License 2.0
124 stars 12 forks source link

Issues Running PostgreSQL with kv_fdw.so and RocksDB 7.0.2 #47

Open kt5965 opened 1 year ago

kt5965 commented 1 year ago

Environment: Ubuntu Server 20.04, PostgreSQL-13, RocksDB-7.0.2

I have attempted to use pgrocks-fdw with RocksDB version 7.0.2. While all compilation steps completed successfully, I am encountering issues when trying to run PostgreSQL. The log file shows the following error:

2023-11-21 06:02:37.735 UTC [56120] LOG: database system is shut down 2023-11-21 06:02:37.981 UTC [73428] FATAL: could not load library "/usr/lib/postgresql/13/lib/kv_fdw.so": /usr/lib/postgresql/13/lib/kv_fdw.so: undefined symbol: _ZTIN7rocksdb12CustomizableE This error indicates an issue with loading the kv_fdw.so library, specifically with the undefined symbol _ZTIN7rocksdb12CustomizableE.

Ensured all compilation steps were correctly followed Verified that the kv_fdw.so library is in the correct location Checked for any possible compatibility issues with the current setup Additional Context: Due to the requirements of other external sources and dependencies, it is necessary for me to use RocksDB version 7.0 or higher. However, it appears that there might be compatibility issues between pgrocks-fdw and RocksDB 7.0.2.

Question: Is the issue I'm experiencing related to the version of RocksDB? Has anyone successfully used pgrocks-fdw with RocksDB version 7.0.2 or higher, and if so, were there any specific steps or modifications required to resolve similar issues?

Any guidance or suggestions on how to resolve this issue would be greatly appreciated.

cardze commented 4 months ago

I solved this by adding -fPIC when compiling rocksDB like this

sudo DEBUG_LEVEL=0 EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 make shared_lib install-shared -j$(nproc)