mirror of
https://github.com/prometheus/prometheus.git
synced 2026-04-29 02:01:14 -04:00
Merge pull request #18219 from machine424/ttyyy
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
fix: fail early when --enable-feature=use-uncached-io is unsupported
This commit is contained in:
commit
f5fe1573ba
4 changed files with 16 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ import (
|
|||
"github.com/prometheus/prometheus/tracing"
|
||||
"github.com/prometheus/prometheus/tsdb"
|
||||
"github.com/prometheus/prometheus/tsdb/agent"
|
||||
"github.com/prometheus/prometheus/tsdb/fileutil"
|
||||
"github.com/prometheus/prometheus/util/compression"
|
||||
"github.com/prometheus/prometheus/util/documentcli"
|
||||
"github.com/prometheus/prometheus/util/features"
|
||||
|
|
@ -319,6 +320,9 @@ func (c *flagConfig) setFeatureListOptions(logger *slog.Logger) error {
|
|||
c.web.EnableTypeAndUnitLabels = true
|
||||
logger.Info("Experimental type and unit labels enabled")
|
||||
case "use-uncached-io":
|
||||
if !fileutil.UncachedIOSupported() {
|
||||
return errors.New("experimental Uncached IO is not supported")
|
||||
}
|
||||
c.tsdb.UseUncachedIO = true
|
||||
logger.Info("Experimental Uncached IO is enabled.")
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -26,3 +26,7 @@ func NewDirectIOWriter(f *os.File, size int) (BufWriter, error) {
|
|||
func NewBufioWriterWithSize(f *os.File, size int) (BufWriter, error) {
|
||||
return NewDirectIOWriter(f, size)
|
||||
}
|
||||
|
||||
func UncachedIOSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,3 +27,7 @@ func NewBufioWriterWithSize(f *os.File, size int) (BufWriter, error) {
|
|||
func NewDirectIOWriter(f *os.File, size int) (BufWriter, error) {
|
||||
return newDirectIOWriter(f, size)
|
||||
}
|
||||
|
||||
func UncachedIOSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,3 +27,7 @@ func NewBufioWriterWithSize(f *os.File, size int) (BufWriter, error) {
|
|||
func NewDirectIOWriter(*os.File, int) (BufWriter, error) {
|
||||
return nil, errDirectIOUnsupported
|
||||
}
|
||||
|
||||
func UncachedIOSupported() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue