yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.18k stars 159 forks source link

Copy command failing via odyssey #554

Open evkuzin opened 8 months ago

evkuzin commented 8 months ago

Hi guys. Odyssey doesn't seem to support copy command. Is it known? Are there any plans? Is it a bug?

against postgres directly:

$ for i in {1..1000}; do echo "run_id_${i},task_id_${i},Some random ${i}th text"; done | psql postgresql://postgres@db:5433/test -c "COPY testing FROM STDIN (FORMAT csv);";
COPY 1000

Via odysssey

$ for i in {1..1000}; do echo "run_id_${i},task_id_${i},Some random ${i}th text"; done | psql postgresql://postgres@db:5432/test -c "COPY testing FROM STDIN (FORMAT csv);";
ERROR:  unexpected message type 0x00 during COPY from stdin
CONTEXT:  COPY testing, line 167
ERROR:  unexpected message type 0x00 during COPY from stdin
CONTEXT:  COPY testing, line 167
FATAL:  terminating connection because protocol synchronization was lost

@x4m in case you know. Thx

x4m commented 8 months ago

AFAIK this was fixed in https://github.com/yandex/odyssey/commit/6ea14ee8bfb02941ca2a1dbefa7b8fa00c00ec71

evkuzin commented 8 months ago

Would have been nice, but I'm using binary built with this and it is much older than your commit. The error is still there 🤷

evkuzin commented 8 months ago

@reshke seems like your fix wasn't enough to fix COPY :(

x4m commented 8 months ago

Do you observer reproduction on actual master?

I'm using binary built with this and it is much older than your commit.

Do you mean newer?

evkuzin commented 8 months ago

🤦 Yup, I meant newer 🤣

evkuzin commented 8 months ago

Update. The issue is with

pool_reserve_prepared_statement yes

in the config Without it, everything works like a charm.