From ef138aaffee8f92732257aae4ac79413ed720181 Mon Sep 17 00:00:00 2001 From: Egor Suvorov Date: Wed, 1 Jun 2022 20:50:15 +0300 Subject: [PATCH] GitHub Actions: pin Rust version to 1.58 like on CircleCI * Fix failing `cargo clippy` while we're here. The behavior has been changed in Rust 1.60: https://github.com/rust-lang/rust-clippy/issues/8928 * Add Rust version to the Cargo deps cache key --- .github/workflows/testing.yml | 4 ++-- pageserver/src/walreceiver.rs | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 41f9f51e8635..aa1e152fb237 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: matrix: # If we want to duplicate this job for different # Rust toolchains (e.g. nightly or 1.37.0), add them here. - rust_toolchain: [stable] + rust_toolchain: [1.58] os: [ubuntu-latest, macos-latest] timeout-minutes: 30 name: run regression test suite @@ -87,7 +87,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }}-rust-${{ matrix.rust_toolchain }} - name: Run cargo clippy run: ./run_clippy.sh diff --git a/pageserver/src/walreceiver.rs b/pageserver/src/walreceiver.rs index df8dd2fc294b..e54406a4505d 100644 --- a/pageserver/src/walreceiver.rs +++ b/pageserver/src/walreceiver.rs @@ -469,12 +469,9 @@ async fn timeline_wal_broker_loop_step( updates = broker_subscription.fetch_data() => match updates { Some(mut all_timeline_updates) => { if let Some(subscribed_timeline_updates) = all_timeline_updates.remove(&id) { - match wal_connection_manager.select_connection_candidate(subscribed_timeline_updates) { - Some(candidate) => { - info!("Switching to different safekeeper {} for timeline {id}, reason: {:?}", candidate.safekeeper_id, candidate.reason); - wal_connection_manager.change_connection(candidate.safekeeper_id, candidate.wal_producer_connstr).await; - }, - None => {} + if let Some(candidate) = wal_connection_manager.select_connection_candidate(subscribed_timeline_updates) { + info!("Switching to different safekeeper {} for timeline {id}, reason: {:?}", candidate.safekeeper_id, candidate.reason); + wal_connection_manager.change_connection(candidate.safekeeper_id, candidate.wal_producer_connstr).await; } } },