-
Notifications
You must be signed in to change notification settings - Fork 404
feat(sdk): fail over to a surviving node when the current one dies #3944
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
aa50652
fix(shard): tell an unknown consensus operation from a corrupt header
numinnex 76460a1
fix(consensus): keep a client's dedup fence across capacity eviction
numinnex 99f5adf
feat(sdk): fail over to a surviving node when the current one dies
numinnex 5fe1a46
fix CI
numinnex 23ceb80
fix CI AGAIN
numinnex c1cc213
merge master
numinnex 6e41c88
merge master
numinnex 2d0b7ae
Merge branch 'master' into multi_endpoint_failover
hubcio a59f226
addres review comments
numinnex e62f2dd
fix CI
numinnex 4433f9a
Merge branch 'master' into multi_endpoint_failover
numinnex 3a0d9d5
address review comments
numinnex 8570d17
merge master
numinnex d0a95b1
address review comments
numinnex 5bda045
address review
numinnex 0e6f965
Merge branch 'master' into multi_endpoint_failover
numinnex b2b9c0e
address review comments
numinnex 4d998cd
Merge branch 'master' into multi_endpoint_failover
numinnex 46c33fd
fix CI
numinnex f3ea3f7
update stale docs
numinnex d2a777c
remove failover_address
numinnex f90f9df
address review comments
numinnex 3bf74df
fix docs
numinnex f117a66
Merge branch 'master' into multi_endpoint_failover
numinnex 9675c0d
Merge branch 'master' into multi_endpoint_failover
hubcio 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
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
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
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
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,66 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| //! An explicit disconnect ends the session for good: the credentials a manual | ||
| //! sign-in remembered (for reconnecting across involuntary drops and | ||
| //! failovers) must not resurrect it. Pins at the Rust layer the contract the | ||
| //! C++ e2e suite asserts through the FFI (`DisconnectThenReconnectWithoutRelogin`, | ||
| //! `GetStatsBeforeLoginThrows`), so a regression fails here first instead of | ||
| //! three suites downstream. | ||
|
|
||
| use iggy::prelude::*; | ||
| use integration::iggy_harness; | ||
|
|
||
| #[iggy_harness] | ||
| async fn given_a_logged_in_client_when_explicitly_disconnected_should_require_a_fresh_login( | ||
| harness: &TestHarness, | ||
| ) { | ||
| let client = harness.new_client().await.unwrap(); | ||
| client | ||
| .login_user(DEFAULT_ROOT_USERNAME, DEFAULT_ROOT_PASSWORD) | ||
| .await | ||
| .unwrap(); | ||
| client.get_me().await.expect("authenticated get_me works"); | ||
|
|
||
| client.disconnect().await.unwrap(); | ||
| client.connect().await.unwrap(); | ||
| assert!( | ||
| matches!(client.get_me().await, Err(IggyError::Unauthenticated)), | ||
| "an explicit disconnect is caller intent, like a logout: the sign-in it ended \ | ||
| must not be silently replayed by the reconnect, so the client's own \ | ||
| authentication gate refuses the request before it is sent" | ||
| ); | ||
|
|
||
| client.disconnect().await.unwrap(); | ||
| assert!( | ||
| matches!(client.get_stats().await, Err(IggyError::NotConnected)), | ||
| "an operation after an explicit disconnect must fail on the dead transport \ | ||
| instead of reconnecting into a resurrected session" | ||
| ); | ||
|
|
||
| // The remembered sign-in exists for involuntary drops; a fresh manual | ||
| // login after the disconnect works exactly as before. | ||
| client.connect().await.unwrap(); | ||
| client | ||
| .login_user(DEFAULT_ROOT_USERNAME, DEFAULT_ROOT_PASSWORD) | ||
| .await | ||
| .unwrap(); | ||
| client | ||
| .get_me() | ||
| .await | ||
| .expect("a fresh login restores service"); | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.