ENT-6511: Increase cf-monitord measurement slots from 100 to 300#6239
Open
nickanderson wants to merge 2 commits into
Open
ENT-6511: Increase cf-monitord measurement slots from 100 to 300#6239nickanderson wants to merge 2 commits into
nickanderson wants to merge 2 commits into
Conversation
~80 of the 100 slots are consumed by default measurements, leaving little room for custom ones. Raise the limit to 300. Kept in sync: CF_OBSERVABLES and the two cf-check copies of the on-disk struct, plus the OBSERVABLES name table (GetObservable() indexes it for unregistered slots, so a short table crashes cf-monitord). cf-check dump now tolerates the shorter records and ts_key a pre-upgrade agent leaves behind. Ticket: ENT-6511 Changelog: Increased the maximum number of cf-monitord measurement slots (CF_OBSERVABLES) from 100 to 300
nickanderson
force-pushed
the
CFE-612-increase-monitor-slots
branch
from
July 20, 2026 15:29
50d4f8a to
2fbdc3d
Compare
Member
Author
|
@cf-bottom jenkins please. |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14244/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14244/ |
nickanderson
marked this pull request as ready for review
July 20, 2026 16:27
larsewi
reviewed
Jul 21, 2026
Comment on lines
+165
to
+168
| // A record written before an increase of CF_OBSERVABLES is shorter than the | ||
| // current struct (e.g. after a package upgrade, until cf-monitord rewrites | ||
| // it). Accept any size up to the full struct and copy into a zeroed struct | ||
| // so the un-stored trailing slots read back as zero. |
Contributor
There was a problem hiding this comment.
Please try to do a DB migration like libpromises/dbm_migration_lastseen.c instead if its possible.
Member
Author
There was a problem hiding this comment.
OK ... this makes me wonder about the other DB backends like tcdb and qmdb and bdb, those aren't covered at all. I guess that's ok we don't vendor any packages with those
Raising CF_OBSERVABLES enlarges the fixed-size Averages record, so records written by an older agent are shorter than the current struct. Added a migration (modelled on dbm_migration_lastseen.c) that rewrites old records to the current size, zero-filling the new slots, registered for the observations and history DBs. This replaces the cf-check dump leniency with a one-time on-disk migration; dump only needs to know the new "version" key. Ticket: ENT-6511 Changelog: None
nickanderson
force-pushed
the
CFE-612-increase-monitor-slots
branch
from
July 21, 2026 14:41
1a91252 to
5f4e187
Compare
Member
Author
|
@cf-bottom jenkins please. |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14253/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14253/ |
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.
Raises
CF_OBSERVABLESfrom 100 to 300. Previously out of the box ~80 of the 100 slots are consumed by default measurements, leaving only ~19 for custommeasurements:promises.Notably, this change does increase the disk footprint required by an agent by
60MB (.27MB per slot). That storage is required even if the slots are not in active use (Ref: ENT-14329)Ticket: ENT-6511