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

fix(http): avoid running out of memory when importing partitioned table over REST API #3638

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

puzpuzpuz
Copy link
Contributor

@puzpuzpuz puzpuzpuz commented Aug 11, 2023

Fixes #3480

By default, the POST /imp REST API endpoint doesn't issue intermediate commits. This PR makes sure that we initialize maxUncommittedRows and o3MaxLag parameters of the CairoTextWriter with the table's defaults, so that writer.ic() calls are made during the import. As a result, the O3 memory won't be unboundedly growing when importing O3 data and chances to run OOM become much smaller.

Also improves timestamp unit description in Sender's Javadoc

@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior REST API Issues or changes relating to the HTTP endpoints labels Aug 11, 2023
@puzpuzpuz puzpuzpuz self-assigned this Aug 11, 2023
@puzpuzpuz puzpuzpuz force-pushed the puzpuzpuz_max_uncommitted_rows_in_imp_endpoint branch from a86244c to 1c6c91d Compare August 11, 2023 14:29
@ideoma
Copy link
Collaborator

ideoma commented Aug 14, 2023

[PR Coverage check]

😍 pass : 16 / 18 (88.89%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/wal/seq/MetadataServiceStub.java 0 1 00.00%
🔵 io/questdb/cairo/wal/WalWriter.java 0 1 00.00%
🔵 io/questdb/cutlass/text/CairoTextWriter.java 13 13 100.00%
🔵 io/questdb/cairo/TableWriter.java 1 1 100.00%
🔵 io/questdb/cutlass/text/TextLoader.java 2 2 100.00%

@bluestreak01 bluestreak01 merged commit 35d5c62 into master Aug 14, 2023
25 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_max_uncommitted_rows_in_imp_endpoint branch August 14, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect or unexpected behavior REST API Issues or changes relating to the HTTP endpoints
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import REST API endpoint requires maxUncommittedRows query parameter to be set to issue intermediate commits
3 participants