Skip to content

Commit a899c65

Browse files
authored
Mark mem ballast flag as deprecated (#5816)
* mark mem ballast flag as deprecated Signed-off-by: Ben Ye <benye@amazon.com> * fix lint Signed-off-by: Ben Ye <benye@amazon.com> * address comments Signed-off-by: Ben Ye <benye@amazon.com> --------- Signed-off-by: Ben Ye <benye@amazon.com>
1 parent 45a4b8e commit a899c65

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [CHANGE] Ingester: Disable uploading compacted blocks and overlapping compaction in ingester. #5735
88
* [CHANGE] Distributor: Count the number of rate-limited samples in `distributor_samples_in_total`. #5714
99
* [CHANGE] Ruler: Remove `cortex_ruler_write_requests_total`, `cortex_ruler_write_requests_failed_total`, `cortex_ruler_queries_total`, `cortex_ruler_queries_failed_total`, and `cortex_ruler_query_seconds_total` metrics for the tenant when the ruler deletes the manager for the tenant. #5772
10+
* [CHANGE] Main: Mark `mem-ballast-size-bytes` flag as deprecated. #5816
1011
* [CHANGE] Querier: Mark `-querier.ingester-streaming` flag as deprecated. Now query ingester streaming is always enabled. #5817
1112
* [FEATURE] Ingester: Add per-tenant new metric `cortex_ingester_tsdb_data_replay_duration_seconds`. #5477
1213
* [FEATURE] Query Frontend/Scheduler: Add query priority support. #5605

cmd/cortex/main.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func main() {
6161
var (
6262
cfg cortex.Config
6363
eventSampleRate int
64-
ballastBytes int
6564
mutexProfileFraction int
6665
blockProfileRate int
6766
printVersion bool
@@ -96,12 +95,14 @@ func main() {
9695
_ = flag.CommandLine.Bool(configExpandENV, false, "Expands ${var} or $var in config according to the values of the environment variables.")
9796

9897
flag.IntVar(&eventSampleRate, "event.sample-rate", 0, "How often to sample observability events (0 = never).")
99-
flag.IntVar(&ballastBytes, "mem-ballast-size-bytes", 0, "Size of memory ballast to allocate.")
10098
flag.IntVar(&mutexProfileFraction, "debug.mutex-profile-fraction", 0, "Fraction of mutex contention events that are reported in the mutex profile. On average 1/rate events are reported. 0 to disable.")
10199
flag.IntVar(&blockProfileRate, "debug.block-profile-rate", 0, "Fraction of goroutine blocking events that are reported in the blocking profile. 1 to include every blocking event in the profile, 0 to disable.")
102100
flag.BoolVar(&printVersion, "version", false, "Print Cortex version and exit.")
103101
flag.BoolVar(&printModules, "modules", false, "List available values that can be used as target.")
104102

103+
//lint:ignore faillint Need to pass the global logger like this for warning on deprecated methods
104+
flagext.DeprecatedFlag(flag.CommandLine, "mem-ballast-size-bytes", "Deprecated: Setting this flag will not take any effect, for similar functionality use GOMEMLIMIT. Size of memory ballast to allocate", util_log.Logger)
105+
105106
usage := flag.CommandLine.Usage
106107
flag.CommandLine.Usage = func() { /* don't do anything by default, we will print usage ourselves, but only when requested. */ }
107108
flag.CommandLine.Init(flag.CommandLine.Name(), flag.ContinueOnError)
@@ -151,10 +152,6 @@ func main() {
151152
}
152153

153154
util_log.InitLogger(&cfg.Server)
154-
155-
// Allocate a block of memory to alter GC behaviour. See https://github.com/golang/go/issues/23044
156-
ballast := make([]byte, ballastBytes)
157-
158155
util.InitEvents(eventSampleRate)
159156

160157
ctx, cancelFn := context.WithCancel(context.Background())
@@ -203,7 +200,6 @@ func main() {
203200
err = t.Run()
204201
cancelFn()
205202

206-
runtime.KeepAlive(ballast)
207203
util_log.CheckFatal("running cortex", err)
208204
}
209205

0 commit comments

Comments
 (0)