-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ccl/backupccl: add memory monitor to external SST iterators in restore
Previously, there was no limit on the amount of memory that can be used while constructing edternal SST iterators during restore. This patch adds a memory monitor to limit the amount of memory that can be used to construct external SST iterators. If a restore processor fails to acquire enough memory to open the next file for a restore span, it will send the iterator for all of the open files it has accumulated so far, and wait until it can acquire the memory to resume constructing the iterator for the remaining files. The memory limit can be controlled via the new cluster setting bulkio.restore.per_processor_memory_limit. Regardless of the setting, however, the amount of memory used will not exceed COCKROACH_RESTORE_MEM_FRACTION * max SQL memory. The new environment variable COCKROACH_RESTORE_MEM_FRACTION defaults to 0.5. Release note: None
- Loading branch information
Rui Hu
committed
May 10, 2023
1 parent
fa92cdd
commit 84ed8ac
Showing
20 changed files
with
1,113 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,39 @@ | ||
load("//build/bazelutil/unused_checker:unused.bzl", "get_x_data") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "backuputils", | ||
srcs = ["utils.go"], | ||
srcs = [ | ||
"memory_backed_quota_pool.go", | ||
"utils.go", | ||
], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/backupccl/backuputils", | ||
visibility = ["//visibility:public"], | ||
deps = ["//pkg/cloud"], | ||
deps = [ | ||
"//pkg/cloud", | ||
"//pkg/util/mon", | ||
"//pkg/util/quotapool", | ||
"//pkg/util/syncutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_cockroachdb_redact//:redact", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "backuputils_test", | ||
srcs = ["memory_backed_quota_pool_test.go"], | ||
args = ["-test.timeout=295s"], | ||
embed = [":backuputils"], | ||
tags = ["ccl_test"], | ||
deps = [ | ||
"//pkg/settings/cluster", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/mon", | ||
"//pkg/util/quotapool", | ||
"//pkg/util/syncutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) | ||
|
||
get_x_data(name = "get_x_data") |
Oops, something went wrong.