yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.95k stars 1.07k forks source link

[YSQL] Invalid argument: Sending too long RPC message (343812350 bytes) (SQLSTATE XX000) #13825

Open sushantrmishra opened 2 years ago

sushantrmishra commented 2 years ago

Jira Link: DB-3332

Description

During bulk loading using voyager following error was observed. Preferably we can measure the size of the batch and send to docDB before the batch size becomes to big.

Invalid argument: Sending too long RPC message (343812350 bytes) (SQLSTATE XX000)

lnguyen-yugabyte commented 2 years ago

I remembered this occurs when the payload of the insert / copy message is too large (exceeding the RPC message size sending to DocDB). If the copy/insert contains multiple rows, we can try to break it down to smaller size, but if a single row insert exceeds such limit it would not help.

lnguyen-yugabyte commented 2 years ago

To reproduce the issue:

yugabyte=# create table test(col text);
CREATE TABLE

<optional> yugabyte=# create index idx on test(col);
CREATE INDEX

yugabyte=# insert into test(col) values (repeat('1234567890', 100000000));
ERROR:  Invalid argument: Sending too long RPC message (2000000287 bytes)

If the secondary index is enabled, we might get a lower threshold for the error.

jasonyb commented 8 months ago

On master 59bc43f786c63b0faef3ca382b5f06165a155d4f, almalinux 8, fastdebug, gcc11 build, yb-ctl rf1 cluster:

CREATE TABLE ttt AS
    SELECT (SELECT ARRAY(SELECT random() FROM generate_series(1, 100000)))
    FROM generate_series(1, 1000);

gives ERROR: Sending too long RPC message (800137886 bytes). Decreasing either number by one zero causes the issue to go away. Running this on vanilla PG 15.2 succeeds. This error message appears to be from YB.