Professional Web Applications Themes

Slave crash - MySQL

Hi, I use a simple Master-Slave-tion 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 ...

  1. #1

    Default Slave crash

    Hi,

    I use a simple Master-Slave-tion 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. #2

    Default Re: Slave crash

    "Markus Wenke" <M.Wenkeweb.de> wrote:
    >
    > I use a simple Master-Slave-tion 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 tion 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 tion (RBR,
    contrary to current statement based tion SBR). RBR tes
    the data of modified rows and thus avoids inconsistencies from certain
    kinds of tion 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

Similar Threads

  1. 'stuck' slave?
    By davidnwelton@gmail.com in forum MySQL
    Replies: 1
    Last Post: April 10th, 05:25 PM
  2. Traffic for Master/Slave
    By Marco Dieckhoff in forum MySQL
    Replies: 3
    Last Post: October 24th, 09:54 AM
  3. InDesign CS CE non-stop CRASH, CRASH, CRASH, CRASH, CRASH, CRASH
    By kajzica@adobeforums.com in forum Adobe Indesign Windows
    Replies: 15
    Last Post: July 2nd, 07:57 PM
  4. using slave flash units
    By Jeff MacVicar in forum Photography
    Replies: 1
    Last Post: July 20th, 01:05 PM
  5. Which flash slave to use?
    By Chris Wakeen in forum Photography
    Replies: 1
    Last Post: July 14th, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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