Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2008 R2 Merge Replication IDENTITY field issues Expand / Collapse
Author
Message
Posted Monday, May 23, 2011 9:56 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 2, 2013 1:54 PM
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
Post #1113427
Posted Monday, May 23, 2011 3:41 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 5:06 PM
Points: 42, Visits: 272
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.
Post #1113666
Posted Tuesday, May 24, 2011 1:45 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 2, 2013 1:54 PM
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
Post #1114376
Posted Wednesday, June 8, 2011 12:27 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 2, 2013 1:54 PM
Points: 16, Visits: 114
I'm still seeing this error in my repl logs and event viewer. Anyone have any ideas?
Post #1122011
Posted Friday, January 6, 2012 11:29 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 10:38 AM
Points: 72, Visits: 287
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.
Post #1231635
Posted Friday, January 6, 2012 12:01 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 10:38 AM
Points: 72, Visits: 287
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?
Post #1231657
Posted Thursday, December 6, 2012 12:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 2, 2014 7:35 AM
Points: 4, Visits: 110
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.
Post #1393359
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse