-
Notifications
You must be signed in to change notification settings - Fork 73
Introduce new configuration parameter failoverMode #434
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
|
The failover parameters table will also need to be updated. |
| this.failoverReaderConnectTimeoutMsSetting = | ||
| FAILOVER_READER_CONNECT_TIMEOUT_MS.getInteger(this.properties); | ||
| this.enableFailoverStrictReaderSetting = ENABLE_FAILOVER_STRICT_READER.getBoolean(this.properties); | ||
| this.failoverModeSetting = FailoverMode.fromValue(FAILOVER_MODE.getString(this.properties)); |
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.
Would it work to remove the failoverModeSetting variable and just set set this.failoverMode to the value in the props? It looks like we set failoverMode to failoverModeSetting in initHostProvider anyways so I'm not sure if we need both variables
| | `enableFailoverStrictReader` | Boolean | No | Set to `true` to only allow failover to reader nodes during the reader failover process. If enabled, reader failover to a writer node will only be allowed for single-node clusters. This logic mimics the logic of the Aurora read-only cluster endpoint. | `false` | | ||
| | Parameter | Value | Required | Description | Default Value | | ||
| |----------------------------------------|:-------:|:--------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `failoverMode` | String | No | Defines a mode for failover process. Failover process may prioritize nodes with different roles and connect to them. Possible values: <br><br>- `strict-writer` - Failover process follows writer node and connects to a new writer when it changes.<br>- `reader-or-writer` - During failover the driver tries to connect to any available/accessing reader node. If no reader is available, the driver can connect to a writer node. This logic mimics the logic of the Aurora read-only cluster endpoint.<br>- `strict-reader` - The driver tries to connect to any available reader node. If no reader is available, the driver raises an error. Reader failover to a writer node will only be allowed for single-node clusters. This logic mimics the logic of the Aurora read-only cluster endpoint.<br><br>If this parameter is omitted, default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader-or-writer`. Otherwise, it's `strict-writer`. | Default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader-or-writer`. Otherwise, it's `strict-writer`. | |
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.
nit: I'd just say 'accessible' instead of 'available/accessing'
| | `enableFailoverStrictReader` | Boolean | No | Set to `true` to only allow failover to reader nodes during the reader failover process. If enabled, reader failover to a writer node will only be allowed for single-node clusters. This logic mimics the logic of the Aurora read-only cluster endpoint. | `false` | | ||
| | Parameter | Value | Required | Description | Default Value | | ||
| |----------------------------------------|:-------:|:--------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `failoverMode` | String | No | Defines a mode for failover process. Failover process may prioritize nodes with different roles and connect to them. Possible values: <br><br>- `strict-writer` - Failover process follows writer node and connects to a new writer when it changes.<br>- `reader-or-writer` - During failover the driver tries to connect to any available/accessing reader node. If no reader is available, the driver can connect to a writer node. This logic mimics the logic of the Aurora read-only cluster endpoint.<br>- `strict-reader` - The driver tries to connect to any available reader node. If no reader is available, the driver raises an error. Reader failover to a writer node will only be allowed for single-node clusters. This logic mimics the logic of the Aurora read-only cluster endpoint.<br><br>If this parameter is omitted, default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader-or-writer`. Otherwise, it's `strict-writer`. | Default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader-or-writer`. Otherwise, it's `strict-writer`. | |
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.
"reader-or-writer - During failover the driver tries to connect to any available/accessing reader node."
- Should
accessinginstead beaccessible?
"If no reader is available, the driver can connect to a writer node."
- Should change
cantowill.
"strict-reader - The driver tries to connect to any available reader node...."
- Might be good to begin this something like "During failover, the driver tries....".
fix RW split tests fix writer failover
Summary
Introduce new configuration parameter "failoverMode"
Additional Reviewers
@karenc-bq
@aaron-congo
@davecramer
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.