mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-30 12:16:40 +09:00
* Stop Boost retries at failed writes and metadata reads Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Retain Boost archives when temporary copies fail Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Reuse Boost cleanup after failed temporary copies Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Acknowledge exact Boost keys without deleting late arrivals Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(boost): cover native acknowledgement and archive handoff Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(boost): match acknowledged keys by epoch, not session-local time Staging fetched keys with FROM_UNIXTIME() converts each epoch through the session time zone. On MySQL in a DST zone both instants of the fall-back hour render as the same local time and are stored back as the first one, so INSERT IGNORE collapses them and the second row is never deleted. It is then fetched, skipped by --skip-past-updates and retained on every run. Stage the epoch integers and compare them with UNIX_TIMESTAMP(time), which reads the TIMESTAMP column's stored value without a time zone conversion. Verified on MySQL 8.4 and MariaDB 11.8 with the session in America/New_York. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(boost): stop bulk drain writes after a rejected flush The bulk drain kept writing a data source's later timestamps after one of its mid-stream flushes failed. That advanced the RRD past the rejected samples, so --skip-past-updates dropped them when the retained shard was retried. Skip the remaining rows of that data source instead. Match the on-demand update result exactly against OK. An error that only contains the letters, for example in an RRD file name such as BOOK_7.rrd, was counted as success and its rows were acknowledged without being written. Describe the acknowledgement DELETE's index use accurately and note why the fall-back fixture shifts only int parameters. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(boost): publish bulk drain probe evidence to the changed-line gate The bulk drain changes in poller_boost.php are exercised only by BoostBulkDrainFailureProbe.php, which compiles the drain in a child process from a temporary file. Xdebug credited those hits to the temporary file, so the changed-line gate saw none of the drain's nine changed statements and the pull request measured 66.7 percent. Keep each loaded function at its original line numbers and map the copy back to its source file, let the drain probe publish request coverage, and run both drain scenarios from a request-coverage fixture whenever poller_boost.php or the probe changes. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(boost): isolate a failing data source instead of its whole shard One data source whose RRD update always fails, for example a corrupt RRD, an unwritable file or a template mismatch, made its pass return -1. The child abandoned its remaining passes and the parent kept every archive table. Each later run added another archive table, re-read all of them, and failed at the same data source again, so data sources after it in that child were never written and work and disk use grew without bound. Park the data sources whose update was rejected on process handler 0 and acknowledge the rest of the shard, so the child carries on. Once every child has finished, the parent copies the parked data sources' samples into poller_output_boost and drops the archive tables as usual. Samples older than one day are discarded with a warning, so a data source that never succeeds cannot grow the queue forever. If parking or the copy fails, the shard or the archive tables are retained as before. Database and metadata failures still fail the whole shard. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(boost): expect a rejected flush to park the data source and acknowledge the shard A rejected mid-stream flush still stops further writes to its data source so a later timestamp cannot advance the RRD past the rejected samples. The data source is now parked for the parent to carry forward instead of retaining the whole shard, so the bulk drain probe expects the shard to be acknowledged. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(boost): run the Boost probes in the changed-line coverage gate Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
9 lines
513 B
PHP
9 lines
513 B
PHP
<?php
|
|
// Copyright (C) 2026 The Cacti Group. Licensed under GPL-2.0-or-later.
|
|
require_once dirname(__DIR__, 3) . '/Helpers/IsolatedProbe.php';
|
|
|
|
test('Boost distinguishes deleted sources from failed metadata reads', function ($scenario, $result) {
|
|
$r = cacti_test_isolated_probe(dirname(__DIR__, 3) . '/fixtures/BoostSourceExistenceProbe.php', [$scenario]);
|
|
expect($r['result'])->toBe($result)->and($r['queries'])->toBe(1);
|
|
})->with([['deleted', 'OK'], ['query-failed', 'ERROR: Unable to verify data source']]);
|