Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Cap the prefetch size so that it does not exceed Int32. #22411

Open
yugabyte-ci opened this issue May 15, 2024 · 1 comment
Open

[YSQL] Cap the prefetch size so that it does not exceed Int32. #22411

yugabyte-ci opened this issue May 15, 2024 · 1 comment
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) jira-originated kind/bug This issue is a bug priority/high High Priority

Comments

@yugabyte-ci
Copy link
Contributor

yugabyte-ci commented May 15, 2024

Jira Link: DB-11320

Repro:

create table large (t text);
for i in {0..42}; do bin/ysqlsh -c "insert into large2 select repeat('abcdefghij', 1024 * 1024) from generate_series(1, 20);"; done
select * from large;

crashes with

F0530 08:53:54.237200 1866919936 casts.cc:21] Bad narrow cast: 4414509210 > 4294967295

(if there are 820 rows, the same select crashes with

F0530 08:52:53.170039 1891250176 yb_rpc.cc:457] Failed to serialize failure: Invalid argument (yb/rpc/serialization.cc:75): Sending too long RPC message (4257222773 bytes)
@yugabyte-ci yugabyte-ci added area/ysql Yugabyte SQL (YSQL) jira-originated kind/bug This issue is a bug priority/low Low priority status/awaiting-triage Issue awaiting triage labels May 15, 2024
@yugabyte-ci yugabyte-ci added priority/high High Priority and removed status/awaiting-triage Issue awaiting triage priority/low Low priority labels May 20, 2024
@andrei-mart
Copy link
Contributor

There are two separate problems.

  1. Unsafe math on size_t type, which size is implementation specific, 32 bits in this particular case. We can enforce 64-bit type.
  2. The "too long RPC message" should be a regular error, properly presented to the user. User can solve that problem in a number of ways:
  • Increase max message size using a gflag (may require DBA privileges and tserver restart)
  • Reduce fetch size
  • Rewrite the queries to fetch shorter row (e.g. exclude some columns).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) jira-originated kind/bug This issue is a bug priority/high High Priority
Projects
None yet
Development

No branches or pull requests

4 participants