<div dir="ltr">Hello,<div>I am running a cluster of asterisk servers and each one is writing the CDR to 2 mysql servers configured with multi master replication using the cdr_adaptive_odbc driver.</div><div><br></div><div style>
cdr_adaptive_odbc.conf has the following configuration:</div><div style><br></div><div style><div>[cdr1]</div><div>connection=asteriskcdrdb1</div><div>table=cdrraw</div><div><br></div><div>[cdr2]</div><div>connection=asteriskcdrdb2</div>
<div>table=cdrraw</div><div><br></div></div><div style>As you can imagine, if both mysql servers are available, every CDR is written twice.</div><div style><br></div><div style>To get rid of duplicates, every query against the cdr database need to use the "DISTINCT" using an intermediate table and that is slow, really slow.</div>
<div style><br></div><div style>Nothing is better if I use a view with the SELECT DISTINCT, it is slower than before.</div><div style><br></div><div style>The only solution I see to add an option in cdr_adaptive_odbc.conf and if set to change the INSERT in the cdr_adaptive_odbc.conf adding a "ON DUPLICATE KEY UPDATE..." or better a "INSERT IGNORE"</div>
<div style><br></div><div style>What do you think about it? </div><div style><br></div><div style>Leandro</div></div>