Code review comment for lp:~percona-core/percona-server/t12-crash-safe-slave

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

Yup, that is precisely the difference and I thought I noted that (maybe
not quite as clearly as you illustrated) in a code comment.

The t12 code does more than just the vanilla InnoDB implementation, it
is almost as if it is 20% implementation of crash safe slave but without
the master/relay overwrite on startup after slave crash.

I don't think calculating backwards after the fact can be easily done
since at the point of calculation we don't have all of the necessary
context info to re-create a proper position. It is a good idea, but I
don't think it is possible.

I can appreciate the desire to not want to duplicate this data in the
trx header and use up even more space and that decision was not made in
haste. When working with this customer, the absolute worst thing we
could do is introduce a change/bug that breaks their existing
application. Since I could get no clear indication from them on how/what
this patch of theirs is used for, we chose to step entirely around it
rather than to try to integrate the two and potentially break whatever
it is they use it for.

Thanks for the thoughtful review Sergei!

On 10/17/2013 8:15 AM, Sergei Glushchenko wrote:
> Seems like vanilla InnoDB stores pointer to the statement which already executed, while we store pointer to the statement which should be executed next. That is why Twitter's test has "SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1".
>
> If we have binlog like this:
>
> BEGIN
> INSERT INTO t1 VALUES (3,0)
> COMMIT;/*1*/
> BEGIN;/*2*/
> INSERT INTO t1 VALUES (4,0);
> COMMIT;
>
> and we just executed COMMIT/*1*/, vanilla InnoDB will point to COMMIT/*1*/ while PS will point to BEGIN/*2*/.
> So we can make this test case to work by just removing "SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1".
>
> If twitter really need pointer to COMMIT/*1*/, can we calculate it? If it is not trivial I agree we have to store it.
>
>

--
George O. Lorch III
Software Engineer, Percona
+1-888-401-3401 x542 US/Arizona (GMT -7)
skype: george.ormond.lorch.iii

« Back to merge proposal