Repository navigation
fix(boost): retain samples across failed writes and late arrivals - #8351
Open
somethingwithproof wants to merge 5 commits into
Open
somethingwithproof wants to merge 5 commits into
somethingwithproof wants to merge 5 commits into
Conversation
somethingwithproof
requested review from
TheWitness
and removed request for
a team
October 13, 2026 05:36
github-actions
Bot
force-pushed
the
fix/boost-retry-acknowledgements
branch
from
October 13, 2026 20:48
5552103 to
fa93ba7
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Oct 14, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
fix/boost-retry-acknowledgements
branch
from
October 17, 2026 06:10
acac38a to
a66da36
Compare
somethingwithproof
force-pushed
the
fix/boost-retry-acknowledgements
branch
3 times, most recently
from
October 17, 2026 20:56
2e88062 to
7910a0d
Compare
github-actions
Bot
force-pushed
the
fix/boost-retry-acknowledgements
branch
7 times, most recently
from
October 23, 2026 20:48
55cd0c3 to
aae10a2
Compare
github-actions
Bot
force-pushed
the
fix/boost-retry-acknowledgements
branch
from
October 26, 2026 20:51
19f417d to
7676619
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
fix/boost-retry-acknowledgements
branch
from
October 28, 2026 20:47
7676619 to
79c76e2
Compare
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This change keeps Boost samples available for retry when a database copy, RRD write or acknowledgement fails. It stops after a rejected buffer and deletes only the keys fetched and successfully stored, using staged keys for the acknowledgement. This prevents later writes or late-arriving samples from being lost through an overly broad cleanup.
Implementation details
When an on-demand Boost buffer fails, processing continues to later timestamps. Those writes can advance the RRD past retained samples, preventing a safe retry. Stop at the first rejected buffer and preserve the queue. Also distinguish a failed source-existence query from a confirmed deleted source so a database failure cannot acknowledge unstored samples.
Temporary-table creation and archive/active-queue copies must all succeed before processing or archive cleanup. A failed copy can otherwise leave the temporary table incomplete and delete closed-round samples that never reached an RRD. Retain those archives, remove any temporary table created by the failed attempt, and release legacy locks before returning failure.
Acknowledge only fetched keys, rather than deleting every row before the cutoff. This preserves late arrivals that were not included in the successful RRD update. The fetched keys are staged in a temporary table and removed by one primary-key delete, so a failed delete leaves every fetched row staged for the next run.
Eight isolated regression cases execute the production functions and cover buffer failures, deleted sources, metadata reads, archive-copy and temporary-table failures, and the all-or-nothing key acknowledgement. The develop Boost suite passes 95 tests on PHP 8.5.11 through mise. Formatting, full PHPStan analysis, and SQL/security guards pass. The matching maintenance suite runs 24 real MariaDB/RRDtool integration cases, including late arrivals and safe retries.
Follow-up to #8332. The maintenance fixes and database/RRDtool handoff cases are in #8334.
Acknowledging with a
(rrd_name, time) IN (...)list was slow on large backlogs: the list does not follow the primary key's column order and degrades roughly quadratically. The delete now joins against the staged keys. Timings for one data source's backlog, in seconds, from the realboost_delete_output_keysin Docker against a table holding 100,000 rows of other data sources (the old range delete is shown for reference; it also deletes late arrivals):Late-arriving rows and other data sources survive in every run. A per-timestamp point delete was slower still (4.7 s at 5,000 rows on MariaDB) and a
(time, rrd_name)reorder of the IN list did not help.Revision and checks
Description scope: target
develop, 9 changed files, head55cd0c333. Checked 2026-10-23 03:06:04 UTC.GitHub check snapshot: 2 passed. Local test figures and earlier CI runs above are recorded evidence for their stated revisions and environments; they do not assert that every check passes at this head.