opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Refactor: Write all queue state to a single key on each write for reliable backup

Open malus2077 opened this issue 7 months ago • 7 comments

  • This change modifies the persistence strategy to write all relevant queue information (start, stop, in-progress, size) together under a single key on every write operation.
  • This ensures a more consistent and reliable backup of the queue's state, improving restoration accuracy after a potential crash.

Fixes #12890

malus2077 avatar May 17 '25 05:05 malus2077

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: malus2077 / name: Alan Lee (eb194f93c3e621b7ce8ceb8a26aee9440aa81b68, a431791da2c0425ae8f9cda60e8d183800db5d59)

Can you please do a PR that only adds the new proposed way (without the replacement or connection) then the second PR to start using that. As you saw there are some questions about this that I would like to address in the first PR, and also some questions about transition.

bogdandrutu avatar May 21 '25 05:05 bogdandrutu

Certainly, I can do that. I'm happy to proceed with the two-PR approach as you've outlined, allowing us to address your questions and concerns regarding the new method and the transition in a structured way.

malus2077 avatar May 21 '25 07:05 malus2077

Can you please do a PR that only adds the new proposed way (without the replacement or connection) then the second PR to start using that. As you saw there are some questions about this that I would like to address in the first PR, and also some questions about transition.

The first PR has been created. #13067

malus2077 avatar May 21 '25 14:05 malus2077

Codecov Report

Attention: Patch coverage is 75.71802% with 93 lines in your changes missing coverage. Please review.

Project coverage is 91.36%. Comparing base (943627b) to head (a431791). Report is 115 commits behind head on main.

Files with missing lines Patch % Lines
...rterhelper/internal/queuebatch/persistent_queue.go 75.71% 69 Missing and 24 partials :warning:

:x: Your patch status has failed because the patch coverage (75.71%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13047      +/-   ##
==========================================
- Coverage   91.53%   91.36%   -0.18%     
==========================================
  Files         504      504              
  Lines       28154    28384     +230     
==========================================
+ Hits        25772    25933     +161     
- Misses       1873     1923      +50     
- Partials      509      528      +19     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 23 '25 17:05 codecov[bot]

Are you planning to update this PR to use already merged code?

I'm currently finalizing the unit tests and getting ready to update the PR.

malus2077 avatar Jun 01 '25 23:06 malus2077

Are you planning to update this PR to use already merged code?

The second PR has been created #13126 , PTAL.

malus2077 avatar Jun 02 '25 05:06 malus2077

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Jun 17 '25 03:06 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar Jul 01 '25 03:07 github-actions[bot]