3 Commits
Author SHA1 Message Date
63a53d511b fix: Make boost_redirect the default boost behavior (develop port of #8559) (#8561)
* fix: Make boost_redirect the default boost behavior

Port of the 1.2.x change (issue#8470) to develop. Boost redirection is now
permanent whenever boost is enabled, so the boost_redirect setting is removed
and the collector always stages poller output directly into
poller_output_boost.

- cmd.php: drop the boost_redirect guard; stage whenever boost_rrd_update_enable
  is on.
- include/global_settings.php, settings.php: remove the boost_redirect setting
  and its UI toggles.
- lib/snmpagent.php: always report the redirect object as enabled.
- poller.php, settings.php: stop force-setting boost_redirect for multi-poller
  installs (boost_rrd_update_enable alone now implies redirection).
- lib/boost.php: boost_poller_on_demand() no longer stages inline; cmd.php owns
  staging, so it only reports rows as already staged and never re-inserts.

Tests are updated to match the single, permanent-redirect pipeline: the
hand-off acknowledgement and consolidation contracts point at the surviving
cmd.php/poller_recovery.php call sites, and the PollerOutput probe drops the
now-dead redirect-off staging scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test(coverage): cover the permanent Boost redirect in snmpagent

Add a request-coverage probe that exercises the permanent
boostApplRrdUpdateRedirect assignment in snmpagent_global_settings_update().
The statement lives in a MibCache-driven function that cannot run under the
unit/integration coverage driver without a live SNMP agent cache, so the
single changed line is compiled at its original line number and executed
against a minimal MibCache stand-in, with Xdebug coverage remapped to
lib/snmpagent.php. Register the probe so the changed-PHP coverage gate runs
it whenever lib/snmpagent.php changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* i18n:

* tests: Cover the cmd.php Boost flush guards for the changed-line gate

Making boost_redirect the default removed the boost_redirect half of the three poller flush conditions in cmd.php, leaving bare read_config_option(boost_rrd_update_enable) guards at lines 392, 501, and 537. Those statements live in cmd.php top-level poller loop, so the unit/integration driver includes them in the denominator but never executes them, dropping changed-line coverage to 3 of 6 (50 percent).

Adds a request-coverage probe that compiles each changed guard at its original line number and executes it against minimal read_config_option/boost_flush_output_batch stand-ins, mirroring the existing snmpagent redirect probe. Xdebug hits are remapped to cmd.php, raising changed-line coverage to 6 of 6 (100 percent). Registers the probe in run_request_coverage.sh so it runs whenever cmd.php changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(boost): keep the boost_redirect compatibility flag enabled

Port the poller.php compatibility assignment from the 1.2.x change
(#8559, commit ba2ab827) that this develop port dropped. Supported
Spine versions still read the hidden boost_redirect flag to stage
poller output into poller_output_boost; without it a compatible
collector never stages, yet boost_poller_on_demand() still reports
the rows as staged and poller_acknowledge_output() deletes them,
losing samples. Set the flag unconditionally before launching
collectors so redirection stays permanent whenever Boost is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 17:28:47 +00:00
TheWitnessandCopilot 76a916cf03 fix(boost): never re-stage poller output when boost_redirect is on (#8374)
* fix(boost): never re-stage poller output when boost_redirect is on

#8332 gated the boost_redirect bypass in boost_poller_on_demand() on the
caller not passing $staged. process_poller_output() always passes it, so
the bypass never fired and the main poller re-inserted every row spine or
cmd.php had already written to poller_output_boost, flooding the log with
"Boost staging ignored N of N duplicate sample keys" warnings.

When boost_redirect is enabled the poller now never inserts into
poller_output_boost and reports the rows as staged so they are cleared
from poller_output. poller_recovery.php writes recovered remote rows via
boost_flush_output_batch() directly and is unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: TheWitness <thewitness@cacti.net>

* chore(changelog): use changelog.d fragment for #8374

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: TheWitness <thewitness@cacti.net>

* fix(boost): log failed poller_output_boost staging as an ERROR

boost_flush_output_batch() returned false silently when the database did
not acknowledge a chunk. cmd.php's boost_redirect staging ignores that
return, so a failed collector-side write left no trace. Log a BOOST ERROR
with the sample count from the helper so every caller's failure is visible.

Adds in-process coverage for the failure log and for boost_poller_on_demand()
never re-staging rows when boost_redirect is on.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: TheWitness <thewitness@cacti.net>

---------

Signed-off-by: TheWitness <thewitness@cacti.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-14 21:13:43 -04:00
Thomas Vincent a12fe59627 fix(poller): [develop] retain output until bounded storage batches succeed (#8332)
* fix(poller): retain output until bounded storage batches succeed

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test(poller): refresh SQL audit after exact-key acknowledgements

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test(boost): preserve handoff contracts with explicit acknowledgements

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(poller): retain failed timestamp ordering across batches

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(poller): acknowledge complete timestamp groups together

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(poller): retry failed source metadata reads on develop

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(poller): preload standalone script exclusions once per process

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(poller): bound metadata failures and validate acknowledgement queries

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-10-12 15:41:53 -07:00