From d1f4a577837b284750bc576c1c2989875a0d4a5f Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Wed, 13 Sep 2023 09:02:04 +0000 Subject: [PATCH 1/4] fix: prof.prefix is write-only --- Cargo.lock | 6 +++--- src/batch/Cargo.toml | 2 +- src/cmd/Cargo.toml | 2 +- src/cmd_all/Cargo.toml | 8 ++++++-- src/compute/Cargo.toml | 2 +- src/compute/src/memory_management/policy.rs | 5 ++--- src/tests/simulation/Cargo.toml | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab1d0077c8386..e23a98a37a067 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8989,7 +8989,7 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" version = "0.5.4" -source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=b7f9f3#b7f9f34664dcfea190e64bef64587e23f9f2710c" +source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=64a2d9#64a2d988d687a94cd859855e19241cd8b0705466" dependencies = [ "libc", "paste", @@ -8999,7 +8999,7 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" version = "0.5.4+5.3.0-patched" -source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=b7f9f3#b7f9f34664dcfea190e64bef64587e23f9f2710c" +source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=64a2d9#64a2d988d687a94cd859855e19241cd8b0705466" dependencies = [ "cc", "libc", @@ -9008,7 +9008,7 @@ dependencies = [ [[package]] name = "tikv-jemallocator" version = "0.5.4" -source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=b7f9f3#b7f9f34664dcfea190e64bef64587e23f9f2710c" +source = "git+https://github.com/risingwavelabs/jemallocator.git?rev=64a2d9#64a2d988d687a94cd859855e19241cd8b0705466" dependencies = [ "libc", "tikv-jemalloc-sys", diff --git a/src/batch/Cargo.toml b/src/batch/Cargo.toml index 5f90151a400ab..65e3634175b99 100644 --- a/src/batch/Cargo.toml +++ b/src/batch/Cargo.toml @@ -67,7 +67,7 @@ rand = "0.8" tempfile = "3" [target.'cfg(unix)'.dev-dependencies] -tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "b7f9f3" } +tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" } [[bench]] name = "filter" diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml index 46a33654d3545..00a5956a3230d 100644 --- a/src/cmd/Cargo.toml +++ b/src/cmd/Cargo.toml @@ -50,7 +50,7 @@ tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git" "profiling", "stats", "unprefixed_malloc_on_supported_platforms", -], rev = "b7f9f3" } +], rev = "64a2d9" } [[bin]] name = "frontend" diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index b6907cdebaeff..b119b32f05f96 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -53,7 +53,11 @@ workspace-hack = { path = "../workspace-hack" } expect-test = "1" [build-dependencies] -vergen = { version = "8", default-features = false, features = ["build", "git", "gitcl"] } +vergen = { version = "8", default-features = false, features = [ + "build", + "git", + "gitcl", +] } [target.'cfg(enable_task_local_alloc)'.dependencies] task_stats_alloc = { path = "../utils/task_stats_alloc" } @@ -63,7 +67,7 @@ tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git" "profiling", "stats", "unprefixed_malloc_on_supported_platforms", -], rev = "b7f9f3" } +], rev = "64a2d9" } [[bin]] name = "risingwave" diff --git a/src/compute/Cargo.toml b/src/compute/Cargo.toml index 7774a2d917731..e0e2a4ab0528b 100644 --- a/src/compute/Cargo.toml +++ b/src/compute/Cargo.toml @@ -55,7 +55,7 @@ tower = { version = "0.4", features = ["util", "load-shed"] } tracing = "0.1" [target.'cfg(target_os = "linux")'.dependencies] -tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "b7f9f3" } +tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" } [target.'cfg(not(madsim))'.dependencies] workspace-hack = { path = "../workspace-hack" } diff --git a/src/compute/src/memory_management/policy.rs b/src/compute/src/memory_management/policy.rs index 5c3602a46fe68..005edb813f823 100644 --- a/src/compute/src/memory_management/policy.rs +++ b/src/compute/src/memory_management/policy.rs @@ -128,9 +128,8 @@ impl JemallocMemoryControl { .unwrap() .to_string() } else { - let prof_prefix_mib = jemalloc_prof::prefix::mib().unwrap(); - let prof_prefix = prof_prefix_mib.read().unwrap(); - let mut file_path = prof_prefix.to_string_lossy().to_string(); + let prof_prefix = jemalloc_opt::prof_prefix::read().unwrap(); + let mut file_path = prof_prefix.to_str().unwrap().to_string(); file_path.push_str(&file_name); file_path }; diff --git a/src/tests/simulation/Cargo.toml b/src/tests/simulation/Cargo.toml index 594f06b3b61c3..b85ea4eceee78 100644 --- a/src/tests/simulation/Cargo.toml +++ b/src/tests/simulation/Cargo.toml @@ -48,7 +48,7 @@ sqllogictest = "0.15.3" tempfile = "3" tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ "profiling", -], rev = "b7f9f3" } +], rev = "64a2d9" } tokio = { version = "0.2.23", package = "madsim-tokio" } tokio-postgres = "0.7" tracing = "0.1" From 562f2f1e085f1f597033cea0237fdfa66da8bca2 Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Wed, 13 Sep 2023 09:14:25 +0000 Subject: [PATCH 2/4] put jemallocator in workspace deps --- Cargo.toml | 5 +++++ src/batch/Cargo.toml | 2 +- src/cmd/Cargo.toml | 6 +----- src/cmd_all/Cargo.toml | 6 +----- src/tests/simulation/Cargo.toml | 4 +--- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 83be53f1d7439..9041fc837daba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,6 +112,11 @@ arrow-schema = "46" arrow-buffer = "46" arrow-flight = "46" arrow-select = "46" +tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ + "profiling", + "stats", + "unprefixed_malloc_on_supported_platforms", +], rev = "64a2d9" } risingwave_backup = { path = "./src/storage/backup" } risingwave_batch = { path = "./src/batch" } diff --git a/src/batch/Cargo.toml b/src/batch/Cargo.toml index 65e3634175b99..35ede881bc47f 100644 --- a/src/batch/Cargo.toml +++ b/src/batch/Cargo.toml @@ -67,7 +67,7 @@ rand = "0.8" tempfile = "3" [target.'cfg(unix)'.dev-dependencies] -tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" } +tikv-jemallocator = { workspace = true } [[bench]] name = "filter" diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml index 00a5956a3230d..f4d3bac3eaa84 100644 --- a/src/cmd/Cargo.toml +++ b/src/cmd/Cargo.toml @@ -46,11 +46,7 @@ workspace-hack = { path = "../workspace-hack" } task_stats_alloc = { path = "../utils/task_stats_alloc" } [target.'cfg(unix)'.dependencies] -tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ - "profiling", - "stats", - "unprefixed_malloc_on_supported_platforms", -], rev = "64a2d9" } +tikv-jemallocator = { workspace = true } [[bin]] name = "frontend" diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index b119b32f05f96..2886f8715706f 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -63,11 +63,7 @@ vergen = { version = "8", default-features = false, features = [ task_stats_alloc = { path = "../utils/task_stats_alloc" } [target.'cfg(unix)'.dependencies] -tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ - "profiling", - "stats", - "unprefixed_malloc_on_supported_platforms", -], rev = "64a2d9" } +tikv-jemallocator = { workspace = true } [[bin]] name = "risingwave" diff --git a/src/tests/simulation/Cargo.toml b/src/tests/simulation/Cargo.toml index b85ea4eceee78..0e7b4e0d8be8f 100644 --- a/src/tests/simulation/Cargo.toml +++ b/src/tests/simulation/Cargo.toml @@ -46,9 +46,7 @@ serde_derive = "1.0.188" serde_json = "1.0.106" sqllogictest = "0.15.3" tempfile = "3" -tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ - "profiling", -], rev = "64a2d9" } +tikv-jemallocator = { workspace = true } tokio = { version = "0.2.23", package = "madsim-tokio" } tokio-postgres = "0.7" tracing = "0.1" From ffe1c3e7466c716292ce49b2088369f9ccfc2424 Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Thu, 14 Sep 2023 05:51:04 +0000 Subject: [PATCH 3/4] fix madsim stack overflow --- Cargo.toml | 1 - src/cmd/Cargo.toml | 4 +++- src/cmd_all/Cargo.toml | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9041fc837daba..12c14770063d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,6 @@ arrow-select = "46" tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [ "profiling", "stats", - "unprefixed_malloc_on_supported_platforms", ], rev = "64a2d9" } risingwave_backup = { path = "./src/storage/backup" } diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml index f4d3bac3eaa84..894d19c9f969a 100644 --- a/src/cmd/Cargo.toml +++ b/src/cmd/Cargo.toml @@ -46,7 +46,9 @@ workspace-hack = { path = "../workspace-hack" } task_stats_alloc = { path = "../utils/task_stats_alloc" } [target.'cfg(unix)'.dependencies] -tikv-jemallocator = { workspace = true } +tikv-jemallocator = { workspace = true, features = [ + "unprefixed_malloc_on_supported_platforms", +] } [[bin]] name = "frontend" diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index 2886f8715706f..f22f0b59ea2db 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -63,7 +63,9 @@ vergen = { version = "8", default-features = false, features = [ task_stats_alloc = { path = "../utils/task_stats_alloc" } [target.'cfg(unix)'.dependencies] -tikv-jemallocator = { workspace = true } +tikv-jemallocator = { workspace = true, features = [ + "unprefixed_malloc_on_supported_platforms", +] } [[bin]] name = "risingwave" From 4069c40ecaba9b1bb008972d74f564ef0f2bbca5 Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Thu, 14 Sep 2023 06:09:23 +0000 Subject: [PATCH 4/4] fix apt-get 404 --- ci/scripts/regress-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/regress-test.sh b/ci/scripts/regress-test.sh index e32eb2c9ad666..3cbf1d58f6a04 100755 --- a/ci/scripts/regress-test.sh +++ b/ci/scripts/regress-test.sh @@ -30,7 +30,7 @@ mv target/debug/risingwave_regress_test-"$profile" target/debug/risingwave_regre chmod +x ./target/debug/risingwave_regress_test echo "--- Postgres regress test" -apt-get -y install locales +apt-get update && apt-get -y install locales locale-gen C export LANGUAGE=C export LANG=C