Replication; Duplicate Entry on Update?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joseph Chase

    #1

    Replication; Duplicate Entry on Update?

    I am running version 4.1.13a-log on a Mac XServe.

    How can I receive a 'duplicate entry' error for an UPDATE? An update isn't
    creating an entry, so why this error message?

    _______________ _______________ _______________ _______
    060427 11:57:23 [Note] Slave SQL thread initialized, starting replication in
    log 'kiosk1-bin.000006' at position 7233, relay log
    './royaldemo-2-relay-bin.000007' position: 7321
    060427 11:57:23 [ERROR] Slave: Query caused different errors on master and
    slave. Error on master: 'Duplicate entry '%-.64s' for key %d' (1062), Error
    on slave: 'no error' (0). Default database: 'rccl'. Query: 'UPDATE pages SET
    `created_at` = '2006-04-26 14:43:04', `template_id` = 4, `ordernum` = 10,
    `location_id` = 4, `user_id` = 1, `serverid` = 10, `name` = 'Trolly 4' WHERE
    id = 92', Error_code: 0
    060427 11:57:23 [ERROR] Error running query, slave SQL thread aborted. Fix
    the problem, and restart the slave SQL thread with "SLAVE START". We stopped
    at lo
    g 'kiosk1-bin.000006' position 45142
    _______________ _______________ _______________ _______

    Any help is greatly appreciated.


  • Gordon Burditt

    #2
    Re: Replication; Duplicate Entry on Update?

    >How can I receive a 'duplicate entry' error for an UPDATE? An update isn't[color=blue]
    >creating an entry, so why this error message?[/color]

    If you modify a column that has a unique key so that the new value
    is not unique, you can get that error.
    [color=blue]
    >060427 11:57:23 [Note] Slave SQL thread initialized, starting replication in
    >log 'kiosk1-bin.000006' at position 7233, relay log
    >'./royaldemo-2-relay-bin.000007' position: 7321
    >060427 11:57:23 [ERROR] Slave: Query caused different errors on master and
    >slave. Error on master: 'Duplicate entry '%-.64s' for key %d' (1062), Error
    >on slave: 'no error' (0). Default database: 'rccl'. Query: 'UPDATE pages SET
    >`created_at` = '2006-04-26 14:43:04', `template_id` = 4, `ordernum` = 10,
    >`location_id ` = 4, `user_id` = 1, `serverid` = 10, `name` = 'Trolly 4' WHERE
    >id = 92', Error_code: 0
    >060427 11:57:23 [ERROR] Error running query, slave SQL thread aborted. Fix
    >the problem, and restart the slave SQL thread with "SLAVE START". We stopped
    >at lo
    >g 'kiosk1-bin.000006' position 45142[/color]

    It looks here like your replication is out of sync. Your master had
    a duplicate record, the slave didn't.

    Gordon L. Burditt

    Comment

    Working...