Stewart Smith <stewart@flamingspork.com> writes:
Idea: if txn touches more than one database, record as metadata the position of other db, so slave just has to wait for at least that id to be applied in other database before applying this txn in this source. This seems like a relatively simple solution to the problem (unless i've missed something).
Yes, this sounds like an interesting idea. More generally, for a given transaction with some global transaction ID, we can optionally log as extra metadata a list of other global transaction IDs that slave must wait for before executing this transaction. In your example, there would be one element in the list, the global transaction ID of the last transaction touching "other db". And it could be used for lots of different other cases as well. Seems kind of nice. But before that, I would want to look into something like this http://askmonty.org/worklog/Server-RawIdeaBin/?tid=184 which allows to apply transactions in parallel on the slave even within the same table. This is a good supplement to the per-database parallel slave apply, which is not sufficient for all applications. - Kristian.