Unverified Commit 385ee3d5 authored by Shubham Dhama's avatar Shubham Dhama Committed by GitHub
Browse files

Improve migration speed by using same connection in a LOB worker. (#533)

Presently, each LOB worker creates a new connection for every object copy,
impacting migration performance, especially with a large number of objects.
The fix here is simple: use the same connection within each worker.

However, while doing so, we encountered an unexpected error:

`BUG: call to pgsql_commit() without holding an open multi statement
connection`

Upon investigation, we discovered that the `connectionStatementType` was
set to an unusual value of 32767. In GDB, it was
(PGSQL_CONNECTION_MULTI_STATEMENT | unknown: 32766). This happens only
after the call of `msgrcv` function. There are a few theories; one suggests
that because both `msg` and `dst` are on the stack, `msgrcv` is overwriting
`dst` data when it should only change `msg`. Despite having
`-fstack-protector` enabled, we did not observe a "stack smashing detected"
error, so maybe this theory is incorrect.

In any case, moving `msg` to the heap seemed to resolve the issue. However,
it's important to fully understand this problem, as it may have
implications in other areas of the code as well.
parent a6a6e3c0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment