Register the st-storage feature flag in the feature registry via
the TSDB options, consistent with how other TSDB features like
exemplar_storage and delayed_compaction are registered.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Coded with Claude Sonnet 4.6.
See the detailed analysis https://docs.google.com/document/d/1efVAMcEw7-R_KatHHcobcFBlNsre-DoThVHI8AO2SDQ/edit?tab=t.0
I ran extensive benchmarks using synthetic data as well as real WAL segments pulled from the prombench runs.
All benchmarks are here https://github.com/prometheus/prometheus/compare/bwplotka/wal-reuse?expand=1
* optimization(tsdb/wlog): reuse Ref* buffers across WAL watchers' reads
Signed-off-by: bwplotka <bwplotka@gmail.com>
* optimization(tsdb/wlog): avoid expensive error wraps
Signed-off-by: bwplotka <bwplotka@gmail.com>
* optimization(tsdb/wlog): reuse array for filtering
Signed-off-by: bwplotka <bwplotka@gmail.com>
* fmt
Signed-off-by: bwplotka <bwplotka@gmail.com>
* lint fix
Signed-off-by: bwplotka <bwplotka@gmail.com>
* tsdb/record: add test for clear() on histograms
Signed-off-by: bwplotka <bwplotka@gmail.com>
* updated WriteTo with what's currently expected
Signed-off-by: bwplotka <bwplotka@gmail.com>
---------
Signed-off-by: bwplotka <bwplotka@gmail.com>
PR #17269 replaced atomic os.Rename-based file writes with
os.WriteFile to fix a Windows flake. However, os.WriteFile is not
atomic (it truncates then writes), and fsnotify can fire between
the truncate and write, causing the watcher to read an empty file
and replace valid targets with empty ones.
Restore atomicity by writing to a temporary file and renaming.
On Windows, retry the rename with a short backoff to handle
transient "Access is denied" errors when the file watcher or
readFile holds an open handle to the destination.
Fixes#18237
Signed-off-by: Munem Hashmi <munem.hashmi@gmail.com>
* Add remyleone as Scaleway maintainer
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Add name and email
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
---------
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
* Show the agent db can hold duplicate series by hash
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Prevent duplicate SeriesRefs from being lost in db stripeSeries
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Drop default initialized value
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* More comments and only reset deleted if the new segment is larger
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Manually manage db/rw to prevent windows test error
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Fix incorrect type from rebase
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Use Set in GetOrSet to enforce proper lock ordering
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Missing period and left over refactor
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
---------
Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
The workflow posts commit status updates via the GitHub API, but
the GITHUB_TOKEN only had 'contents: read', causing HTTP 403 on
all statuses API calls.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
When a label-name position is followed by comma or brace-close, only
treat it as a metric name shorthand if the token was a double-quoted
string (tQString). Bare identifiers must be followed by an equal sign.
Add tests for bare identifier inputs that previously could panic.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>