Ask a Question related to MySQL, Design and Development.

  1. #1

    Default Slave crash

    Hi,

    I use a simple Master-Slave-Replication with one Master and one Slave.(
    MySQL 5.1.11-beta-log)

    If I crash's the slave (Power off) while some INSERT's in a Transaction
    are running, and restarts the slave after that, the slave don't start:
    060901 8:57:27 [ERROR] Slave: Error 'Duplicate entry '85105' for key
    'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO
    TestTable (text) values ("Test: 1 257")', Error_code: 1062
    060901 8:57:27 [Warning] Slave: Duplicate entry '85105' for key
    'PRIMARY' Error_code: 1062
    060901 8:57:27 [Warning] Slave: Unknown error Error_code: 1105
    060901 8:57:27 [ERROR] Error running query, slave SQL thread aborted.
    Fix the problem, and restart the slave SQL thread with "SLAVE START".
    We stopped at log 'Master-bin.000008' position 3672742


    I use "sync_binlog=1" on Master and Slave.

    Is it a Problem because I use a "beta"-Version?


    thanks in advance

    Markus

    Markus Wenke Guest

  2. Similar Questions and Discussions

    1. 'stuck' slave?
      Hi, I have a mysql slave database, that, for various reasons, got quite out of date with its master. Friday, when I left, it was happily...
    2. Traffic for Master/Slave
      Hi! How much traffic does a master/slave configuration produce beyond the inserted/updated data? As to say: How much "meta"-traffic is to be...
    3. InDesign CS CE non-stop CRASH, CRASH, CRASH, CRASH, CRASH, CRASH
      Sofware is orig., and OS is win2000 pro, or 2003 server or win2000 server. Any doc with litle more text crash indesign non-stop. With any updates...
    4. using slave flash units
      I'm having to do some group family portraits indoors. I have three small slave flash units to use with the main flash on my slr. can anyone advise...
    5. Which flash slave to use?
      A while back I posted here looking for recommendations regarding which optical slave to use. I ended up using a Nikon SU-4. It worked fine but all...
  3. #2

    Default Re: Slave crash

    "Markus Wenke" <M.Wenke@web.de> wrote:
    >
    > I use a simple Master-Slave-Replication with one Master and one Slave.(
    > MySQL 5.1.11-beta-log)
    >
    > If I crash's the slave (Power off) while some INSERT's in a Transaction
    > are running, and restarts the slave after that, the slave don't start:
    > 060901 8:57:27 [ERROR] Slave: Error 'Duplicate entry '85105' for key
    > 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO
    > TestTable (text) values ("Test: 1 257")', Error_code: 1062
    > 060901 8:57:27 [Warning] Slave: Duplicate entry '85105' for key
    > 'PRIMARY' Error_code: 1062
    > 060901 8:57:27 [Warning] Slave: Unknown error Error_code: 1105
    > 060901 8:57:27 [ERROR] Error running query, slave SQL thread aborted.
    > Fix the problem, and restart the slave SQL thread with "SLAVE START".
    > We stopped at log 'Master-bin.000008' position 3672742
    >
    > I use "sync_binlog=1" on Master and Slave.
    >
    > Is it a Problem because I use a "beta"-Version?
    This is a general replication problem. The slave keeps track of its
    current position in the binlog by writing the position to the files
    'master.info' (I/O thread) and 'relay-log.info' (SQL thread).
    However those files are not written synchronously.

    If the slave experiences an unclean shutdown, chances are that the
    real position of the slave in the binlog is behind the one recorded in
    'relay-log.info'. In consequence the slave will do some statements
    twice. If there are transactions, they may be done twice (as a whole).
    This may lead to errors like above, or - even worse - to silent data
    corruption.

    So if your slave crashes hard, you better restore it from a backup.


    Announcement: MySQL 5.1 introduces row based replication (RBR,
    contrary to current statement based replication SBR). RBR replicates
    the data of modified rows and thus avoids inconsistencies from certain
    kinds of replication errors.

    Example: with SBR the statement UPDATE foo SET bar=bar*2 WHERE baz=42
    will lead to increasing inconsistency between master and slave if there
    was a difference before or if this statement is executed twice on the
    slave. With RBR master and slave will be in sync afterwards, no matter
    what they were before.


    XL
    --
    Axel Schwenke, Senior Software Developer, MySQL AB

    Online User Manual: [url]http://dev.mysql.com/doc/refman/5.0/en/[/url]
    MySQL User Forums: [url]http://forums.mysql.com/[/url]
    Axel Schwenke Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139