Bug #2348 replication option to ignore deletes on certain db / tables
Submitted: 11 Jan 2004 11:21 Modified: 26 Oct 2007 9:40
Reporter: Stefan Praszalowicz Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:4.0 or 4.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[11 Jan 2004 11:21] Stefan Praszalowicz
Feature request: an option or set of options, in the series of '--replicate-ignore-table', to let a slave execute inserts and updates on certain databases or tables, but ignore deletes.

Some background:
We use replication to keep our stats server in sync with the production server; the production server contains a LOG database that receives lots of inserts. 

Productions apps need this data, but only up to a month old, so we want to purge the production db in order to keep it as small as possible (to get an idea, we're talking about 100K new rows per day).

At the same time we would like to keep all this data on the stats server... our current solution involves copying the LOGS db on the stats server to another db (aptly named full_LOG). This is not a good solution since it involves lots of copying, updating a set of shell scripts when we add tables etc...

It would be much easier if we could just tell a slave (the stats server) to ignore DELETE statements on the LOGS database.

This feature could be generalized to let people configure exactly which statements they want to allow on which db/tables, ie allow inserts but not update nor delete, or just delete or whatever.

If you guys think this is a worthy feature (which I'm about sure it is) please let me know; I'm willing to code it if you tell me it has a chance of being included (as a feature, of course the patch I'd send could be unperfect or whatnot). Given the amount of options of this kind already implemented I guess it should be trivial to add this one, which could even mean inclusion in 4.0 ?

Thanks !

Stefan Praszalowicz

How to repeat:

Suggested fix:
[26 Jul 2006 15:07] Magnus Blåudd
Thank you for taking the time to report a problem.  Unfortunately you are not using a current version of the product you reported a problem with -- the problem might already be fixed. Please download a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions, please change the version on this bug report to the version you tested and change the status back to "Open".  Again, thank you for your continued support of MySQL.

See this link:
[24 Oct 2007 14:15] Sebastian Nohn
Could you please specify, which option you are referring to?
[24 Oct 2007 17:03] Stefan Praszalowicz
Closing this as nobody even takes a minute to read the bloody message: nevermind !
[25 Oct 2007 10:52] Sebastian Nohn
I read your message very well and was asking Magnus which option [there is none] he is referring to.
[26 Oct 2007 9:40] Magnus Blåudd
Sorry about that. I read it as you wanted "--replicate-ignore-db", but you apparently would like to have "--replicate-ignore-deletes-db".

Setting it back to Verified as Feature request.

What I would like suggest is to try and use the new features in 5.0 to solve this problem. For example using views in some way.

Or if you check 5.1 there is partioning. http://dev.mysql.com/tech-resources/articles/mysql_5.1_partitioning_with_dates.html