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
Please register or sign in to comment