Skip to content

Commit 49447a5

Browse files
authored
fix: concurrency problems at local metadata store (#4175)
* chore: use parking_lot for local metadata locks * chore: enable local_upgrade_test again * chore: add resume test * chore: run the local-resume-test 5 times * chore: remove flush sync_all * chore: parking_lot as optional
1 parent 8c1fda3 commit 49447a5

File tree

7 files changed

+162
-97
lines changed

7 files changed

+162
-97
lines changed

.github/workflows/ci.yml

+101-50
Original file line numberDiff line numberDiff line change
@@ -945,56 +945,107 @@ jobs:
945945
path: diagnostics*.gz
946946
retention-days: 1
947947

948-
# FIXME: This is disabled until we fix the problem with the test when creating a new topic
949-
# local_upgrade_test:
950-
# name: Upgrade local cluster test on (${{ matrix.run }})
951-
# needs: build_primary_binaries
952-
# runs-on: ${{ matrix.os }}
953-
# strategy:
954-
# # fail-fast: false
955-
# matrix:
956-
# os: [ubuntu-latest]
957-
# rust-target: [x86_64-unknown-linux-musl]
958-
# run: [r1]
959-
# steps:
960-
# - uses: actions/checkout@v4
961-
# # Download artifacts
962-
# - name: Download artifact - fluvio
963-
# uses: actions/download-artifact@v4
964-
# with:
965-
# name: fluvio-${{ matrix.rust-target }}
966-
# path: ~/bin
967-
# - name: Download artifact - fluvio-run
968-
# uses: actions/download-artifact@v4
969-
# with:
970-
# name: fluvio-run-${{ matrix.rust-target }}
971-
# path: ~/bin
972-
# - name: Mark executable
973-
# run: |
974-
# chmod +x ~/bin/fluvio-run
975-
# chmod +x ~/bin/fluvio && ~/bin/fluvio version
976-
# echo "${HOME}/bin" >> $GITHUB_PATH
977-
#
978-
# - name: Run upgrade test with CI artifacts
979-
# timeout-minutes: 10
980-
# env:
981-
# TEST_DATA_BYTES: 10000
982-
# run: |
983-
# date
984-
# make FLUVIO_MODE=local FLUVIO_BIN=~/bin/fluvio upgrade-test
985-
#
986-
# - name: Run diagnostics
987-
# if: ${{ !success() }}
988-
# timeout-minutes: 5
989-
# run: fluvio cluster diagnostics
990-
# - name: Upload logs
991-
# timeout-minutes: 5
992-
# if: ${{ !success() }}
993-
# uses: actions/upload-artifact@v4
994-
# with:
995-
# name: local_upgrade_${{ matrix.run }}_log
996-
# path: diagnostics*.gz
997-
# retention-days: 1
948+
local_upgrade_test:
949+
name: Upgrade local cluster test on (${{ matrix.run }})
950+
needs: build_primary_binaries
951+
runs-on: ${{ matrix.os }}
952+
strategy:
953+
# fail-fast: false
954+
matrix:
955+
os: [ubuntu-latest]
956+
rust-target: [x86_64-unknown-linux-musl]
957+
run: [r1]
958+
steps:
959+
- uses: actions/checkout@v4
960+
# Download artifacts
961+
- name: Download artifact - fluvio
962+
uses: actions/download-artifact@v4
963+
with:
964+
name: fluvio-${{ matrix.rust-target }}
965+
path: ~/bin
966+
- name: Download artifact - fluvio-run
967+
uses: actions/download-artifact@v4
968+
with:
969+
name: fluvio-run-${{ matrix.rust-target }}
970+
path: ~/bin
971+
- name: Mark executable
972+
run: |
973+
chmod +x ~/bin/fluvio-run
974+
chmod +x ~/bin/fluvio && ~/bin/fluvio version
975+
echo "${HOME}/bin" >> $GITHUB_PATH
976+
977+
- name: Run upgrade test with CI artifacts
978+
timeout-minutes: 10
979+
env:
980+
TEST_DATA_BYTES: 10000
981+
run: |
982+
date
983+
make FLUVIO_MODE=local FLUVIO_BIN=~/bin/fluvio upgrade-test
984+
985+
- name: Run diagnostics
986+
if: ${{ !success() }}
987+
timeout-minutes: 5
988+
run: fluvio cluster diagnostics
989+
- name: Upload logs
990+
timeout-minutes: 5
991+
if: ${{ !success() }}
992+
uses: actions/upload-artifact@v4
993+
with:
994+
name: local_upgrade_${{ matrix.run }}_log
995+
path: diagnostics*.gz
996+
retention-days: 1
997+
998+
local_resume_test:
999+
name: Resume local cluster test on (${{ matrix.run }})
1000+
needs: build_primary_binaries
1001+
runs-on: ${{ matrix.os }}
1002+
strategy:
1003+
# fail-fast: false
1004+
matrix:
1005+
os: [ubuntu-latest]
1006+
rust-target: [x86_64-unknown-linux-musl]
1007+
run: [r1]
1008+
steps:
1009+
- uses: actions/checkout@v4
1010+
# Download artifacts
1011+
- name: Download artifact - fluvio
1012+
uses: actions/download-artifact@v4
1013+
with:
1014+
name: fluvio-${{ matrix.rust-target }}
1015+
path: ~/bin
1016+
- name: Download artifact - fluvio-run
1017+
uses: actions/download-artifact@v4
1018+
with:
1019+
name: fluvio-run-${{ matrix.rust-target }}
1020+
path: ~/bin
1021+
- name: Mark executable
1022+
run: |
1023+
chmod +x ~/bin/fluvio-run
1024+
chmod +x ~/bin/fluvio && ~/bin/fluvio version
1025+
echo "${HOME}/bin" >> $GITHUB_PATH
1026+
- name: Install Parallel
1027+
run: sudo apt-get install -y parallel
1028+
1029+
- name: Run resume test with CI artifacts
1030+
timeout-minutes: 10
1031+
env:
1032+
TEST_DATA_BYTES: 10000
1033+
run: |
1034+
date
1035+
make FLUVIO_BIN=~/bin/fluvio resume-test
1036+
1037+
- name: Run diagnostics
1038+
if: ${{ !success() }}
1039+
timeout-minutes: 5
1040+
run: fluvio cluster diagnostics
1041+
- name: Upload logs
1042+
timeout-minutes: 5
1043+
if: ${{ !success() }}
1044+
uses: actions/upload-artifact@v4
1045+
with:
1046+
name: local_upgrade_${{ matrix.run }}_log
1047+
path: diagnostics*.gz
1048+
retention-days: 1
9981049

9991050
# Smoke test across different version of fluvio
10001051
cli_smoke:

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ mimalloc = "0.1.39"
115115
mime = "0.3"
116116
nix = { version = "0.29.0", default-features = false }
117117
once_cell = "1.7.2"
118+
parking_lot = { version = "0.12.3", default-features = false }
118119
pin-project = "1.1.0"
119120
portpicker = "0.1.1"
120121
proc-macro2 = "1.0"

crates/fluvio-stream-dispatcher/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "fluvio_stream_dispatcher"
1212
path = "src/lib.rs"
1313

1414
[features]
15-
local = ["fluvio-stream-model/use_serde", "fluvio-stream-model/k8", "serde_yaml"]
15+
local = ["fluvio-stream-model/use_serde", "fluvio-stream-model/k8", "serde_yaml", "parking_lot"]
1616
k8 = ["fluvio-stream-model/k8", "k8-client", "serde_json"]
1717

1818
[dependencies]
@@ -26,6 +26,7 @@ once_cell = { workspace = true }
2626
serde = { workspace = true, features = ['derive'] }
2727
serde_json = { workspace = true, optional = true }
2828
serde_yaml = { workspace = true, optional = true }
29+
parking_lot = { workspace = true, features = ["send_guard"], optional = true }
2930
tokio = { workspace = true, features = ["macros"] }
3031
tracing = { workspace = true }
3132
tempfile = { workspace = true }

0 commit comments

Comments
 (0)