Skip to content
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

fix: panic when dumping memory profile #12276

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ arrow-schema = "46"
arrow-buffer = "46"
arrow-flight = "46"
arrow-select = "46"
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
"stats",
], rev = "64a2d9" }

risingwave_backup = { path = "./src/storage/backup" }
risingwave_batch = { path = "./src/batch" }
Expand Down
2 changes: 1 addition & 1 deletion src/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { workspace = true }

[[bench]]
name = "filter"
Expand Down
6 changes: 2 additions & 4 deletions src/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ 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",
tikv-jemallocator = { workspace = true, features = [
"unprefixed_malloc_on_supported_platforms",
], rev = "b7f9f3" }
] }

[[bin]]
name = "frontend"
Expand Down
12 changes: 7 additions & 5 deletions src/cmd_all/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ 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" }

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
"stats",
tikv-jemallocator = { workspace = true, features = [
"unprefixed_malloc_on_supported_platforms",
], rev = "b7f9f3" }
] }

[[bin]]
name = "risingwave"
Expand Down
2 changes: 1 addition & 1 deletion src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use the workspace dependency? 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tikv-jemalloc-ctl is different from tikv-jemallocator, and it's only used in compute for memory controller policy. Are you sure to move it to workspace dependency as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can never exist two different version of jemalloc ctl
/allocator. So use worksapce makes sense to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it can be used in all nodes for profiling

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tikv-jemalloc-ctl is different from tikv-jemallocator, and it's only used in compute for memory controller policy.

Oh, I didn't realize this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it can be used in all nodes for profiling

Agree. Let's do it upon that time!

[target.'cfg(not(madsim))'.dependencies]
workspace-hack = { path = "../workspace-hack" }

Expand Down
5 changes: 2 additions & 3 deletions src/compute/src/memory_management/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
4 changes: 1 addition & 3 deletions src/tests/simulation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "b7f9f3" }
tikv-jemallocator = { workspace = true }
tokio = { version = "0.2.23", package = "madsim-tokio" }
tokio-postgres = "0.7"
tracing = "0.1"
Expand Down
Loading