-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENT-11838: Fixed perpetual warnings that a deleted host has checked in #5617
base: master
Are you sure you want to change the base?
Conversation
larsewi
commented
Oct 10, 2024
•
edited
Loading
edited
- Added acknowledge field to lastseen DB
- Added acknowledge function for lastseen entries
Lastseen migration seems to work after upgrading from nightly package to this PR 🚀
|
6ab8894
to
80e9540
Compare
New field seems to do the job when built together with https://github.com/cfengine/nova/pull/2339
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me otherwise. Good that we already an implementation for migration strategies 😁
This field can be used to acknowledge an update to an incoming or outgoing host entry in the lastseen DB. The field is set to `false` when a key-value pair is updated. `cf-hub` may at any time acknowledge that the update has been observed by setting the field to `true`. Ticket: ENT-11838 Changelog: Title Signed-off-by: Lars Erik Wik <[email protected]>
c323fd4
to
00aa149
Compare
d979054
to
9d820d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me otherwise.
Added function to acknowledge the observation of a lastseen entry in DB. Ticket: ENT-11838 Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool.
if ((key[0] != 'k') && (key[0] != 'a')) | ||
{ | ||
Log(LOG_LEVEL_WARNING, | ||
"Found unexpected key '%s' during lastseen migration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Found unexpected key '%s' during lastseen migration", | |
"Found unexpected key '%s' during lastseen migration. Only expecting 'k' or 'a' prefixed keys.", |
|
||
if (!WriteDB(db, "version", "2", sizeof("2"))) | ||
{ | ||
Log(LOG_LEVEL_ERR, "Failed to update version number durling lastseen migration"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log(LOG_LEVEL_ERR, "Failed to update version number durling lastseen migration"); | |
Log(LOG_LEVEL_ERR, "Failed to update version number during lastseen migration"); |
return false; | ||
} | ||
|
||
Log(LOG_LEVEL_INFO, "Migrated lastseen database from version 1 to 2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With all the failure/return false cases above what state is the database left in?