Skip to content

fix: data loss in asyncsearch merge caused by concurrent retention deletion of fracs#459

Open
eguguchkin wants to merge 1 commit into
mainfrom
0-fix-async-searche-merge-missing-frac
Open

fix: data loss in asyncsearch merge caused by concurrent retention deletion of fracs#459
eguguchkin wants to merge 1 commit into
mainfrom
0-fix-async-searche-merge-missing-frac

Conversation

@eguguchkin

Copy link
Copy Markdown
Collaborator
  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

PR Title Validation Failed
Please refer to CONTRIBUTING.md

@eguguchkin eguguchkin changed the title fix(async-search): fixes data loss in asyncsearch merge caused by concurrent retention deletion of fracs fix: data loss in asyncsearch merge caused by concurrent retention deletion of fracs Jul 7, 2026
@eguguchkin eguguchkin added the bug Something isn't working label Jul 7, 2026
@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.74%. Comparing base (25381c2) to head (4cf18dd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
+ Coverage   70.51%   70.74%   +0.22%     
==========================================
  Files         232      232              
  Lines       18268    18271       +3     
==========================================
+ Hits        12881    12925      +44     
+ Misses       4426     4389      -37     
+ Partials      961      957       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
MutexListAppend-4 25381c 9d4289
199.21 MB/s 175.59 MB/s 0.88 🔴
80797744.00 ns/op 91119098.00 ns/op 1.13 🔴

@eguguchkin eguguchkin force-pushed the 0-fix-async-searche-merge-missing-frac branch from d8a766a to 4cf18dd Compare July 7, 2026 19:13
@eguguchkin eguguchkin requested review from cheb0 and dkharms July 9, 2026 08:04
if err != nil {
if os.IsNotExist(err) {
// the corresponding fraction may have been removed concurrently by retention,
// so the qpr file may not exist

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wait, but we are reading the .qpr file here which has different lifetime and does not depend on fraction's lifetime. Am I missing something?

Or you mean retention of asyncsearcher (like how long asynchronous request can survive)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Issue: when a user starts an async search with from close to the last fraction, the search may take hours. By the time it reaches that fraction, it might already be gone due to rotation. We currently ignore this as a valid case (

if !ok { // oldest fracs may already be removed
). However, when we later merge all remaining fractions, a missing fraction's qpr fails the ENTIRE merge.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Anyway, the async search queue will be reworked to use intervals soon, but for now we see this error a few times a week in logs. Users don't notice the missing data, but we should fix it sooner rather than later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants