473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

replication blues


Hi guys,

I've got a weirdo problem with replicating a database. Sometimes I get
some duplicate keys problems for _only_ one table. There is nothing
special about this table, it looks like:

+----------+--------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------+--------------------------------------+------+-----+---------+----------------+
| id | int(10) unsigned | | PRI | NULL |
auto_increment |
| dialer | int(10) unsigned | YES | | NULL |
|
| uid | int(10) unsigned | | | 0 |
|
| action | enum('REGENERATE','CREATE','DELETE') | YES | | NULL |
|
| acc_no | int(10) unsigned | YES | | NULL |
|
| template | int(10) unsigned | YES | | NULL |
|
| name | varchar(20) | YES | | NULL |
|
| status | enum('OKAY','ERROR') | | | OKAY |
|
+----------+--------------------------------------+------+-----+---------+----------------+
And data is inserted into it with simple inserts, w/o specifing the id
(it's autoincrementing).

With a little debugging, I have located the problem. If I run 'alter
table xxx auto_increment=1' on both the master and the slave (this table
is empty at the time on both machines), and then I insert datas into the
master, they look like:

On master:

+----+--------+------+------------+--------+----------+---------------+--------+
| 1 | 3 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 2 | 4 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 3 | 5 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 4 | 6 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 5 | 13 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 6 | 14 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 7 | 18 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 8 | 19 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 9 | 20 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 10 | 21 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
+----+--------+------+------------+--------+----------+------+--------+

But on slave it looks like:

+----+--------+------+------------+--------+----------+------+--------+
| id | dialer | uid | action | acc_no | template | name | status |
+----+--------+------+------------+--------+----------+------+--------+
| 10 | 3 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 11 | 4 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 12 | 5 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 13 | 6 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 14 | 13 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 15 | 14 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 16 | 18 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 17 | 19 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 18 | 20 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
| 19 | 21 | 1007 | REGENERATE | NULL | NULL | NULL | OKAY |
+----+--------+------+------------+--------+----------+------+--------+
Why does it start on the id=10 on the slave? Of course, this is the
cause for the replication failures later on, because datas are deleted on
the master with 'delete from xxx where id=3', for example, action which
doesn't delete anything on the slave (because there is no id=3 entry),
thus inconsistency.

I'm using 4.0.13 on both machines.

Thanks,
bogdan


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1126

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank | last post by:
Hi, we are using oracle clients (Release 9.0.1.0.1 - Production) on an NT4 (Service Pack6) computers. the server is a W2K, (Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production With the...
2
by: Cherrish Vaidiyan | last post by:
Hello, I have certain doubts regarding replication of Oracle 9i in Red Hat Linux 9. 1) I want to implement asynchronous/synchronous multimaster replication.I have heard about Replication...
0
by: Cherrish Vaidiyan | last post by:
Frank <fbortel@nescape.net> wrote in message news:<bqgb99$a04$1@news1.tilbu1.nb.home.nl>... > Cherrish Vaidiyan wrote: > > Hello, > > > > I have certain doubts regarding replication of Oracle 9i ...
6
by: John | last post by:
Hi We have an access app (front-end+backend) running on the company network. I am trying to setup replication for laptop users who go into field and need the data synched between their laptops...
3
by: dlesandrini | last post by:
I need advice about my decision to go with Replication in general. This post was placed on the Microsoft Replication newsgroup, but I really value the feedback that comes from this group as well. ...
56
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving...
9
by: David W. Fenton | last post by:
See: Updated version of the Microsoft Jet 4.0 Service Pack 8 replication files is available in the Download Center http://support.microsoft.com/?scid=kb;en-us;321076 This includes the Jet 4...
3
by: Gert van der Kooij | last post by:
Hi, Our SQL Replication is between DB2 databases on Windows servers. I'm searching for the document which tells me how to migrate our SQL Replication environment from V8 to V9 (we also need to...
2
by: Query Builder | last post by:
Hi, I have transactional replication set up on on of our MS SQL 2000 (SP4) Std Edition database server Because of an unfortunate scenario, I had to restore one of the publication databases. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.