-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Do not assume we hear back from all linked projects when validating resolved index expressions for CPS #137916
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
Open
pawankartik-elastic
wants to merge
8
commits into
elastic:main
Choose a base branch
from
pawankartik-elastic:pkar/cps-validate-no-response-linked-project
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+194
−11
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1581480
Do not assume we hear back from all linked projects when validating r…
pawankartik-elastic 4d0428a
Add test cases with project routing
pawankartik-elastic c48dec5
Update docs/changelog/137916.yaml
pawankartik-elastic 10dc85e
Merge branch 'main' into pkar/cps-validate-no-response-linked-project
pawankartik-elastic 3162119
`rm` TODO in `_resolve/index`
pawankartik-elastic 0fbe3f0
Merge branch 'main' into pkar/cps-validate-no-response-linked-project
pawankartik-elastic 3f0f215
Merge branch 'main' into pkar/cps-validate-no-response-linked-project
pawankartik-elastic 7d67fb8
Merge branch 'main' into pkar/cps-validate-no-response-linked-project
pawankartik-elastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 137916 | ||
| summary: Do not assume we hear back from all linked projects when validating resolved | ||
| index expressions for CPS | ||
| area: CCS | ||
| type: enhancement | ||
| issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are good, but I feel like the overall change would be more convincing if changing this broke some existing test. Since it doesn't can we modify an existing test to test this scenario too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It never broke any existing test because in our tests, we always assumed:
AFAIK, we did not account for the scenario where we never heard back from a linked project, which could trip
checkSingleRemoteExpression()in production. This is why the CPS-resolve index API currently throws an error if the number of responses from the linked projects does not match the number of requests fanned out.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we not account for such a scenario? One reason I can think of is that to make that happen, we'd have to make the linked project unresponsive. We currently cannot do that, and it always responds with either "there's no such index" or "there exists such an index" (which happens through SAF and
ResolvedIndexExpressions).Edit: I may have a way to mimic such scenarios. Let me give it a try tomorrow! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so I managed to write a relevant test for Serverless (see the linked PR). Without these changes, the test would ideally crash because we hit the
assertand in production, it'd NPE.