- 
                Notifications
    You must be signed in to change notification settings 
- Fork 76
Updating filters as well during Alias update #491
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
Conversation
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.
LGTM
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
| Codecov Report
 @@             Coverage Diff              @@
##               main     #491      +/-   ##
============================================
- Coverage     75.16%   74.59%   -0.58%     
+ Complexity     1007     1005       -2     
============================================
  Files           141      141              
  Lines          4579     4582       +3     
  Branches        506      507       +1     
============================================
- Hits           3442     3418      -24     
- Misses          823      844      +21     
- Partials        314      320       +6     
 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. | 
| var aliasAction = AliasActions.add().index(followerIndexName) | ||
| .alias(alias.alias) | ||
| .indexRouting(alias.indexRouting) | ||
| .searchRouting(alias.searchRouting) | ||
| .writeIndex(alias.writeIndex()) | ||
| .isHidden(alias.isHidden) | ||
|  | ||
| if (alias.filteringRequired()) { | ||
| aliasAction = aliasAction.filter(alias.filter.string()) | ||
| } | 
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.
Can we also check if any other attributes need to be copied?
For example in addition to indexRouting & searchRouting, there is routing attribute.
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.
Yes, I have checked for all the attributes . routing attribute gets converted into indexRouting & searchRouting
| .writeIndex(alias.writeIndex()) | ||
| .isHidden(alias.isHidden) | ||
| ) | ||
| var aliasAction = AliasActions.add().index(followerIndexName) | 
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.
we should consider having validation checks after overall metadata update, obtain diff and publish the index stats.
- Can we employ similar mechanism as restore for updating overall index metadata?
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.
Yes, we can enhance the status api to reflect the same .
Can we employ similar mechanism as restore for updating overall index metadata?
the current metadata sync is a condensed version for same. What is main delta in the mechanism you are referring to ? can we track these as part of other issue and take that forward ?
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.
we should consider having validation checks after overall metadata update, obtain diff and publish the index stats.
Are you referring to comparing with leader again? If so, it may be end up with false positives as updates to metadata/alias on leader could be moving target. If not, then agree - it can be a simpler validation by comparing "expected" update which we can capture while building request object.
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.
Are you referring to comparing with leader again? If so, it may be end up with false positives as updates to metadata/alias on leader could be moving target
No, i was referring to the response already obtained as part of the this update from the leader. This will ensure that the metadata diff we obtained from the leader(minus replication specific settings etc) is on par with the current updated index state on the follower.
What is main delta in the mechanism you are referring to ? can we track these as part of other issue and take that forward ?
I was referring to the diff on overall IndexMetadata itself but in the current form, the response obtained from the leader (minus repl metadata for the index which we want to override) and the response after the update from the follower index.
Ideally, these two should be equal and any deviation from this should be counted towards replication_metadata_failure as part of the index stats.
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.
Opened issue to track the overall changes - #498
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.
Overall fix looks good to me and we can track validation of applied metadata separately. Only contingent action is on getting successful CI run post which we can merge this.
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
| The backport to  To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.1 1.1
# Navigate to the new working tree
cd .worktrees/backport-1.1
# Create a new branch
git switch --create backport/backport-491-to-1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4470a774e4a49d72423c07af87a7754eeeb5116a
# Push it to GitHub
git push --set-upstream origin backport/backport-491-to-1.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.1Then, create a pull request where the  | 
| The backport to  To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-491-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4470a774e4a49d72423c07af87a7754eeeb5116a
# Push it to GitHub
git push --set-upstream origin backport/backport-491-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2Then, create a pull request where the  | 
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Testing : Integ Test, Local Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Description
Alias filter changes aren't getting replicated to follower cluster.
On inspecting code, the logic to replicate alias is missing code to replicate filter. This results in inconsistent alias on the follower end whenever an alias filter is updated.
This change adds the logic to copy the filters as well . I have also verified that there is no other alias metadata we are missing.
Issues Resolved
#490
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.