Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7656583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:48:10+00:00 2026-05-31T12:48:10+00:00

I have a standard one directional master-slave setup. The tables have MyIsam storage engine.

  • 0

I have a standard one directional master-slave setup.
The tables have MyIsam storage engine.

The Versions are:

Master
Server version: 5.1.41-3ubuntu12.10-log
Protocol version: 10

1st Slave:
Server version: 5.1.41-3ubuntu12.10
Protocol version: 10

2nd Slave:
Server version: 5.1.49-1ubuntu8.1
Protocol version: 10

I have set up all users beside a dedicated replication user to be read only on the slaves.

The following statement, executed on the master, gets not replicated correctly:

$insert = "INSERT INTO search_affiliate_product
(film_id, ext_id, affiliate_id, `status`, url, created_at)
SELECT film_id, LPAD(imdb, 7, '0'), $affiliate_id, 5, CONCAT('http://www.imdb.com/title/tt', LPAD(imdb, 7, '0'),'/'), NOW() FROM search_film_entity
WHERE film_id NOT IN (SELECT film_id FROM search_affiliate_product WHERE affiliate_id = $affiliate_id)
AND status IN (5, 9)
AND release_year BETWEEN 0 AND $year
AND imdb > 0";

The slave gets this error:

Error 'Duplicate entry '271769' for key 'PRIMARY'' on query. Default database:     'flimmit_search_14'. Query: 'INSERT INTO `search_affiliate_product` (`affiliate_id`,     `ext_id`, `url`, `status`, `film_id`, `created_at`, `updated_at`) VALUES ('16', '1991/JohnnyStecchino', 'http://www.cineman.ch/movie/1991/JohnnyStecchino/review.html', '5', '102164', '2011-10-26 02:30:05', '2011-10-26 02:30:05')'

I also made some other observations:

  • The statement gets transferred “as is” over the bin log (relay log and master log), so the explicit data that is inserted is not contained, but the whole statement with the select and subselect is executed on the slave, relying on the local data.

  • If i look at the master and slave table and sort by primary key, I see a range of inserts produced by the statement above on both servers. The rows before and after that are in sync. Also a lot of rows in that range that is produced by that statement is equal. But there are also discrepancies.

I thought that the problem may because by concurrent sql transactions. So that the inserting process interferes with other inserts and therefore the values get mixed up, where on the slave this does not happen because the log is processed procedurally.

I also noticed that during the inserting process of the statement some IDs seem to be inserted that are not inserte on the other server, and some duplicates get inserted (duplicates on the field ext_id which is populated by the imdb field from the other table, which is unique…

I am really stuck here.

Any suggestions? I would really like to understand why this is happening.

I thought about selecting all the ids and making single insert statements in the application or lock the table before executing it. I think this could solve it, but i would really like to understand the error.

The next weird thing is that the second slave seems to run fine! only the first slave is getting problems. I just don’t understand it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:48:12+00:00Added an answer on May 31, 2026 at 12:48 pm

    this kind of replication can only be done reliably under innodb with the following settings in place on the client

    [mysqld]
    innodb_flush_log_at_trx_commit=1
    sync_binlog=1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the standard setup of one main image and multiple thumbnails which can
I have one application which uses the standard .NET forms authentication cookie, now I
I have a JavaScript widget which provides standard extension points. One of them is
I have a standard windows server that inherits from the ServiceBase class. On the
In the UITabBarController I have implemented.. (the standard one).. when an item is selected,
I have a user control that creates a jQuery DatePicker (standard one in the
I have jqzoom all setup and everything works great except a couple things, one
I have a standard many-to-one relationship set up. There are a bunch of fields,
Many languages have standard repositories where people donate useful libraries that they want others
I've heard they have standard GUI guideline, but I can't seem to find a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.