Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server 2008 R2 Merge Replication IDENTITY field issues


SQL Server 2008 R2 Merge Replication IDENTITY field issues

Author
Message
benm 37301
benm 37301
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 114
We've recently migrated from a SQL 2005 configuration over to 2008 R2 and are now experiencing an error on publications that contain tables with identity fields.
I know that when you replicate an identity field, the publisher doles out ranges to each subscriber and maintains the ranges.
So when a subscriber fills up its range, it asks the publisher for a new range.
The problem we're seeing is that tables that have identity fields and are replicated but not being used by any process are throwing an error saying that it was unable to obtain a new identity range.

Here is the message from the job history:

...
2011-05-23 15:11:02.316 The Publisher failed to allocate a new set of identity ranges for the subscription. This can occur when a Publisher or a republishing Subscriber has run out of identity ranges to allocate to its own Subscribers or when an identity column data type does not support an additional identity range allocation. If a republishing Subscriber has run out of identity ranges, synchronize the republishing Subscriber to obtain more identity ranges before restarting the synchronization. If a Publisher runs out of identit
2011-05-23 15:11:02.425 Category:NULL
Source: Merge Replication Provider
Number: -2147199417
Message: The Publisher failed to allocate a new set of identity ranges for the subscription. This can occur when a Publisher or a republishing Subscriber has run out of identity ranges to allocate to its own Subscribers or when an identity column data type does not support an additional identity range allocation. If a republishing Subscriber has run out of identity ranges, synchronize the republishing Subscriber to obtain more identity ranges before restarting the synchronization. If a Publisher runs out of identit
2011-05-23 15:11:02.518 Category:SQLSERVER
Source: NTIIARDB
Number: 20666
Message: Cannot refresh the identity range and/or the check constraint on the Publisher. Ensure the following: that the value in the identity column has not reached the maximum for the data type in the identity column; and that the user who made the last insert has the privileges to drop and re-create the check constraint.


In this publication, there is one table that has an identity field and has not had records added to it since august 2010 and the total record count is 6; so this table must be the cause of the error message.
We have the job scheduled to run every 5 minutes throughout the day and this message shows up about once an hour or so randomly throughout the day.
Data is still being replicated normally even when this message shows up.

How can I resolve this issue?

Thanks in advance,
Ben
henners72
henners72
SSC Rookie
SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)

Group: General Forum Members
Points: 42 Visits: 313
If the table is duly ever updated I would suggest removing the identity and adding a trigger to assign the pk for inserts. Easy fix but not recommended on tables with alot of activity.
benm 37301
benm 37301
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 114
I believe your solutions would help, but I don't think that would solve the issue.
There are tables with identity columns used by a 3rd party software that we cannot change.
So changing the identity to a trigger will not work for all tables in my databases.

This issue is affecting 4 different publications that contain about a dozen tables from 4 different databases.
Only the publications with tables that have identity fields are being affected.
Many of these tables are updated regularly and I could see those filling up the range and throwing the error.
But what is puzzling is that this message is showing for a table that does not have inserts/updates/deletes made against it.
This tells me that either something is configured wrong or there is a bug in the system.
I am continuing to see these errors show up constantly throughout the day with seemingly no provocation.
Any ideas on how to solve this?

Ben
benm 37301
benm 37301
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 114
I'm still seeing this error in my repl logs and event viewer. Anyone have any ideas?
@SixStringSQL
@SixStringSQL
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 371
Ben, have you had any luck resolving this?

I too see this. I'm upgrading from 2005, with four republishers. I'm trying new topologies: 6 Republishers, and No Republishers. In both scenarios, I see this ID problem. With the repubs, it is between the Master and the Repub. With No Repubs, it is between the CE subscriber, and the publisher.
@SixStringSQL
@SixStringSQL
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 371
I need to solve this, so I may end up opening a case with MS...

So far, it appears that it isn't a *real* ID conflict:

1) Subsequent syncs work without giving the same error
2) The errors increase logrithmically as the load is increased

I'm guessing some kind of blocking/lock conflict. I'm going to try a trace with the blocking report. Anyone have a better way to look for such an internal conflict?
Vijay-154675
Vijay-154675
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 115
Did anyone ever happen to resolve this issue? I have been reading a lot about the identity issue with merge replication on SQL 2008, but havent come across a solution yet. This issue is haunting me. This happens on articles that have lot of activity. It is not that the entire range allocated us used up, rather sometimes it is 20% used up and a new range is allocated, sometimes 50%, sometimes 100% as expected, and sometimes it doesnt allocate new range at all.

Someone please let me know if there is a fix to this. I am also planning to open a case with MS, soon if dont find a resolution on net.

Thanks in advance.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search