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: Use a SandboxedPersistentQueryMetadata to not interact with KafkStreams #6066

Merged
merged 3 commits into from
Aug 25, 2020

Conversation

spena
Copy link
Member

@spena spena commented Aug 20, 2020

Description

The RequestValidator validates every request made to KSQL using sandboxed classes that prevents modifying real data or metadata, such as creating/deleting topics, schema, etc. Even the queries running in the system are copied to prevent they're deleted during the TERMINATE validation. However, the internal KafkaStreams of the copied QueryMetadata is altered. The streams is closed which includes closing the original KafkaStreams.

This PR sandboxes the PersistentQueryMetadata to prevent terminating the KafkaStreams during the request validation process.

Testing done

Added unit tests.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@spena spena requested a review from a team August 20, 2020 19:51
Copy link
Member

@stevenpyzhang stevenpyzhang left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

The change lgtm, I think it's missing some test coverage

@spena spena force-pushed the sandbox_query_metadata branch from 3a1b5e3 to 8f103b7 Compare August 24, 2020 16:48
spena added 2 commits August 24, 2020 20:38
- override only start/stop methods
- add test case for not start/stop/close streams in ksqlengine sandbox
@spena spena force-pushed the sandbox_query_metadata branch from 8656d55 to d5e4f73 Compare August 25, 2020 01:39
@spena spena force-pushed the sandbox_query_metadata branch from d5e4f73 to 6081eaf Compare August 25, 2020 03:09
@spena spena merged commit e000b41 into confluentinc:master Aug 25, 2020
@spena spena deleted the sandbox_query_metadata branch August 25, 2020 16:48
sarwarbhuiyan pushed a commit to sarwarbhuiyan/ksql that referenced this pull request Sep 4, 2020
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