-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Database error due to failed constraint when syncing agent information #23349
Comments
I was able to reproduce the error, but under one condition: The error could be reproduced in 4.8.0-rc1 and 4.7.4, but not in 4.7.3. 4.8.0-rc1Detele agent: cluster.log (master):
ossec.log (master):
4.7.4Detele agent: cluster.log (master):
ossec.log (master):
Note: The error could not be reproduced if the agent is stopped prior to the execution of the deletion and waiting a few seconds for the information to be synchronized and marked as disconnected. Log analysis (4.8.0-rc1 master)At 18:56:51 the agent is deleted: In the
and then a few seconds later a query
here is where the error occurs, because the cluster is trying to insert a Continuing looking at the cluster logs and it is seen that the error only occurs at that time, then the cluster can complete the synchronization: cluster.log
ConclusionIn my opinion, the inclusion of the clause “REFERENCES agent(id)” is correct and evidences cluster failures in the synchronization of agent information, since as we saw, after the agent deletion, information of that deleted agent is synchronized. |
I disagree with it being a cluster failure, as we understand from a design perspective that the cluster synchronization tasks are not atomic with other operations taking place in local databases, and as such, those databases are responsible for their own mechanisms to protect integrity. However, I also understand from the investigation that we do not have any failure from the db itself and that it is recovering properly without any consequences. I consider this as completed with not further actions required. |
Description
During #23333, a modification in the
src/wazuh_db/schema_global.sql
file was found that may be the origin of an error that appears when agents are deleted with theDELETE /agents
request and theAgent-info sync
tries to synchronize the information between the worker and the master. The request does not directly modify the database to remove the agents, it instead sends a command to theauthd
process.ossec.log
The text was updated successfully, but these errors were encountered: