Skip to content

Add query comment to ignore max memory row limit#6430

Merged
deepthi merged 2 commits intovitessio:masterfrom
tinyspeck:ignore-max-memory-rows
Jul 23, 2020
Merged

Add query comment to ignore max memory row limit#6430
deepthi merged 2 commits intovitessio:masterfrom
tinyspeck:ignore-max-memory-rows

Conversation

@spark4
Copy link
Copy Markdown
Contributor

@spark4 spark4 commented Jul 9, 2020

Overview

We currently have warn and max thresholds for the number of rows that can be returned by a given query. However, there exists no mechanism for ignoring the max_memory_rows limit for a given query when this flag is enabled. This PR introduces a new query comment directive that will allow us to ignore the max_memory_rows limit, similar to that for max_payload_size in this PR.

Relevant Issue: #6213
Relevant PR: #6143

Implementation

  1. Define a new comment directive DirectiveIgnoreMaxMemoryRows.
  2. Extract the DirectiveIgnoreMaxMemoryRows value at the executor step and pass that into vcursor for later validation.
  3. Skip MaxMemoryRows validation if DirectiveIgnoreMaxMemoryRows is set.

Testing

Testing was done via unit testing and manual testing. The following manual test cases were covered:

  • Inserts/updates/deletes continue to work as expected
  • Selects within the max_memory_rows limit continue to work as expected
  • Selects that exceed the max_memory_rows limit fail as expected
  • Selects that exceed the max_memory_rows limit that have the DirectiveIgnoreMaxMemoryRows query comment will succeed as expected

@spark4 spark4 requested a review from sougou as a code owner July 9, 2020 20:54
@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Jul 18, 2020

@spark4 can you resolve the conflicts?

@deepthi deepthi requested review from harshit-gangal and systay July 18, 2020 20:45
@spark4 spark4 force-pushed the ignore-max-memory-rows branch from b5e1167 to ca3cbed Compare July 20, 2020 18:32
@spark4 spark4 force-pushed the ignore-max-memory-rows branch from ca3cbed to 666223d Compare July 20, 2020 18:48
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice expansion of the test cases

Signed-off-by: Serry Park <me@serry.co>
@spark4 spark4 force-pushed the ignore-max-memory-rows branch from 666223d to 09cbcb1 Compare July 23, 2020 00:05
Copy link
Copy Markdown
Contributor Author

@spark4 spark4 Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this out since this may be easy to miss and the other comment is no longer relevant -- setting this explicitly to true since this is being called within StreamExecute

…arser calls

Signed-off-by: Serry Park <me@serry.co>
@spark4 spark4 force-pushed the ignore-max-memory-rows branch from 09cbcb1 to bce9c2a Compare July 23, 2020 00:32
Copy link
Copy Markdown
Collaborator

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Jul 23, 2020

Unit tests are failing as you can see here: https://github.com/vitessio/vitess/actions?query=branch%3Aignore-max-memory-rows
A few more changes are needed in legacy_scatter_conn_test.go. We can merge once those are fixed.

@spark4
Copy link
Copy Markdown
Contributor Author

spark4 commented Jul 23, 2020

@deepthi the unit test failures should have been resolved by the last commit. Is there an easy way to restart tests that have been stuck in queued? It looks like some have been stuck in this state since last night.

@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Jul 23, 2020

@deepthi the unit test failures should have been resolved by the last commit. Is there an easy way to restart tests that have been stuck in queued? It looks like some have been stuck in this state since last night.

You can click on Details and Re-run. Let me know if you don't have the permissions to re-run and I can fix that.
I just re-ran unit 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants