-
Notifications
You must be signed in to change notification settings - Fork 21
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
Mysql replication and service_state multiple unique indexes #535
Comments
Hi, Thanks for the report.
It would fix the problem. Though it might impact JOIN performance. Since MySQL 8, row-based replication is the default, if I'm not mistaken. Have you considered changing it? All the best, |
Hello, I didn't considered changing it. I don't know if
|
SuggestionI don't know all the Icinga DB Web queries, but I guess it doesn't need both TYPE_state#id and TYPE_state#TYPE_id to be unique for optimal join performance. Not to change any Web queries we could even make TYPE_state#TYPE_id the primary key and the id non-unique. The values are the same anyway. Or! Web could make TYPE_id just an alias of id in its ORM. And we can deUNIQUEify TYPE_id. What do you think? |
@nilmerg Is this reasonable? |
I'd say yes. Though, an alias isn't even necessary. |
Please explain. Would one re-write existing joins instead? Or aren't there such? Or (why) do the JOIN performance problems Eric mentioned above not exist? |
The join to host_state and service_state are always made from host or service respectively. Using the primary key as foreign key in this case might sound weird, but works fine. |
Describe the bug
When the database icingadb is replicated, when the table service_state is updated, the following error occurs:
To Reproduce
Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include configuration, logs, etc. to reproduce, if relevant.
Expected behavior
No error should occur.
Your Environment
Include as many relevant details about the environment you experienced the problem in
Additional context
Last week, the error occured 21160 times.
binlog_format
is set toMIXED
(default value)I suppose the problem is at https://github.com/Icinga/icingadb/blob/master/schema/mysql/schema.sql#L494 . I don't know if removing the
UNIQUE
constraint fixes the problem nor has any other implication.Thank you
The text was updated successfully, but these errors were encountered: