Flight transport TLS cert hot-reload - #20700
Conversation
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
PR Reviewer Guide 🔍(Review updated until commit 5f295a4)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 5f295a4 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 0e23fc7
Suggestions up to commit 1ee835b
|
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
|
Persistent review updated to latest commit 0e23fc7 |
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
|
Persistent review updated to latest commit 5f295a4 |
|
❌ Gradle check result for 5f295a4: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❕ Gradle check result for 5f295a4: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20700 +/- ##
============================================
- Coverage 73.25% 73.24% -0.02%
- Complexity 71966 72003 +37
============================================
Files 5781 5782 +1
Lines 329414 329427 +13
Branches 47531 47530 -1
============================================
- Hits 241307 241281 -26
- Misses 68741 68820 +79
+ Partials 19366 19326 -40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e63a443
into
opensearch-project:main
* Arrow Flight: support TLS cert hot-reload Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * Changelog entry Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * address comment and fix flaky test Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> (cherry picked from commit e63a443) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Arrow Flight: support TLS cert hot-reload Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * Changelog entry Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * address comment and fix flaky test Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> (cherry picked from commit e63a443) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Flight transport TLS cert hot-reload (#20700) * Arrow Flight: support TLS cert hot-reload Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * Changelog entry Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * address comment and fix flaky test Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> (cherry picked from commit e63a443) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Remove outdated entries from CHANGELOG Removed several entries related to plugin access, cluster name validation, and range validations. Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
* Arrow Flight: support TLS cert hot-reload Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * Changelog entry Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * address comment and fix flaky test Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
* Arrow Flight: support TLS cert hot-reload Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * Changelog entry Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> * address comment and fix flaky test Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> --------- Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Description
DefaultSslContextProviderhad a// TODO - handle certificates reload— when the Security plugin reloaded certs viaPUT /_plugins/_security/api/ssl/{transport,http}/reloadcerts, the Flight server and client kept serving the old cert until node restart.ReloadableSslContext— newSslContextwrapper that callssupplier.get().newEngine()on every connection, so reloaded certs are picked up immediately. Reload chain:reloadcertsAPI → Security plugin updatesSslContextHandler→provider.parameters()reads it →ReloadableSslContext.newEngine()serves the new cert.DefaultSslContextProvider— wraps server/client contexts inReloadableSslContext, removing the TODO.FlightTransport— removedFlightClientcache;initiateChannelnow creates aFlightClientper connection (called once per node byClusterConnectionManager) andFlightClientChannel.close()owns its lifecycle — matching the per-connection pattern ofSecureNetty4Transport.Tests
ReloadableSslContextTests— in-JVM TLS handshake before/after swapping the supplier; asserts cert serial changes on the next connection.ReloadableSslContextFlightIT— realFlightServer/FlightClient; swaps supplier, forces reconnect viaManagedChannel.enterIdle(), asserts new cert serial is served.How I tested it
Tested on a 2-node cluster with Security plugin (
ssl_cert_reload_enabled: true). A script records cert serials on both ports (Flight 9401/9402), generates a new self-signed cert, swaps it on disk, callsreloadcerts, and asserts the serial changed on every Flight port — without restarting either node.Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.