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

pkg/metrics/wal: always write series records to WAL, even on rollback #4619

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Jul 27, 2023

If a new series is introduced in a storage.Appender instance, that series should be written to the WAL once the storage.Appender is closed, even on Rollback.

Previously, new series would only be written to the WAL when calling Commit. However, because the series is stored in memory regardless, subsequent calls to Commit may write samples to the WAL which reference a series ID which that was never written.

Port of prometheus/prometheus#12592

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592
@rfratto rfratto requested review from mattdurham and tpaschalis July 27, 2023 13:36
@rfratto rfratto requested a review from a team as a code owner July 27, 2023 13:36
@mattdurham
Copy link
Collaborator

Is there a good way to add tests to this?

@rfratto
Copy link
Member Author

rfratto commented Jul 27, 2023

Is there a good way to add tests to this?

@mattdurham I added a test case, PTAL

Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

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

Lgtm

@rfratto rfratto merged commit 3837d47 into grafana:main Jul 27, 2023
@rfratto rfratto deleted the port-prometheus-12592 branch July 27, 2023 16:09
rfratto added a commit to rfratto/agent that referenced this pull request Jul 27, 2023
…grafana#4619)

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592

(cherry picked from commit 3837d47)
rfratto added a commit that referenced this pull request Jul 27, 2023
* prometheus.operator.*: fix UI issues (#4538)

(cherry picked from commit 11e0087)

* Fix nil reference oauth2 (#4548)

* Fix nil reference oauth2

* Update CHANGELOG.md

Co-authored-by: Robert Fratto <[email protected]>

---------

Co-authored-by: Robert Fratto <[email protected]>
(cherry picked from commit bbfbf37)

* pkg/metrics/wal: always write series records to WAL, even on rollback (#4619)

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592

(cherry picked from commit 3837d47)

* Fix issue with fips on behalf of @andrewimeson (#4622)

(cherry picked from commit 234b056)

* agentctl: add journald support (#4544)

Add journald support into agentctl so `grafana-agentctl test-logs`
functions properly when using a config which reads log entries from the
systemd journal.

Fixes #4520.

(cherry picked from commit f254860)

* [release-v0.35] prepare for release v0.35.2

(cherry picked from commit 138dc34)

---------

Co-authored-by: mattdurham <[email protected]>
dwalker-sabiogroup pushed a commit to dwalker-sabiogroup/agent that referenced this pull request Jul 28, 2023
…grafana#4619)

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
…#4619)

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
…#4619)

If a new series is introduced in a storage.Appender instance, that
series should be written to the WAL once the storage.Appender is closed,
even on Rollback.

Previously, new series would only be written to the WAL when calling
Commit. However, because the series is stored in memory regardless,
subsequent calls to Commit may write samples to the WAL which reference
a series ID which that was never written.

Port of prometheus/prometheus#12592
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants