Showing posts with label publisher. Show all posts
Showing posts with label publisher. Show all posts

Saturday, 25 February 2012

Conflicts from nowhere

I have two tables that are getting conflicts between the subscriber and the publisher, however I am pretty sure we only update these tables at the subscriber.

I have column level tracking turned on.

The tables both have Nonoverlapping, single subscription (3) set for partition options. I wonder does this do any maintenance to the tables?

I have put in place some triggers to audit what makes changes to the data, but won't know until tomorrow, so if there is something that anyone knows about that might help, please let me know.

Thanks

Hi,

Could you return the contents of MSmerge_conflicts_info and MSmerge_conflict_publication_article table for the article where the conflict occurred? Also, there are probably some information about conflict in merge agent history. Do you have some primary key, foreign key constraint on publisher only? That will cause conflict if the subscriber row violated the constraint and failed to be applied on publisher.

Hope it helps.

Wanwen

|||some more questions as well - what does the filtered column look like, and are you updating the filtered column?|||The filtered column is a bit field and is only updated at the server - with the partition options set to 3 (and use partition groups set to true) you cannot change that value at the subscriber. The field gets read only permissions in the database.|||The triggers I put in place to audit the updates to the table I am conerned with revealed that there were no updates occuring that were not expected.

So, what happens is the data gets inserted via a biztalk process. The data then gets synchronised to a mobile device where an update occurs.

Upon synchronisation, the data updates going back are met with a conflct - wwhich must surely be all but impossible if nothing has touched the data on the server.

To make matters worse, this doesn't occur for every updated record only for some of them. It also does not occur to other tables set up in the same way.

Something is very fishy about this..|||

Hi,

Could you please give more information so we can try to understand and repro the problem?

Could you return the contents of MSmerge_conflicts_info and MSmerge_conflict_publication_article table for the article where the conflict occurred? Also, there are probably some information about conflict in merge agent history. Do you have some primary key, foreign key constraint on publisher only? That will cause conflict if the subscriber row violated the constraint and failed to be applied on publisher.

Do you have join filters defined in your publication? when you do update, do you update the rows on both base article and join article? what is your subset_filter and join filter looks like?

Thanks

Wanwen

|||OK, more information as requested (should have done this when you asked the first time).

Two articles in my database that I am getting these unexplained
conflicts for.
job_travel
meter

CREATE TABLE [dbo].[job_travel](
[jot_id] [uniqueidentifier] NOT NULL CONSTRAINT [df_jot_id] DEFAULT (newid()),
[jot_guid] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [df_jot_guid] DEFAULT (newsequentialid()),
[jot_job_id] [uniqueidentifier] NOT NULL,
[jot_travel_start] [datetime] NULL,
[jot_travel_stop] [datetime] NULL,
[jot_travel_duration] [int] NULL,
[jot_is_active] [bit] NOT NULL CONSTRAINT [df_jot_is_active] DEFAULT ((1)),
CONSTRAINT [pk_jot_id] PRIMARY KEY CLUSTERED
(
[jot_id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF)
)

CREATE TABLE [dbo].[meter](
[met_id] [uniqueidentifier] NOT NULL CONSTRAINT [df_met_id] DEFAULT (newid()),
[met_guid] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [df_met_guid] DEFAULT (newsequentialid()),
[met_job_id] [uniqueidentifier] NOT NULL,
[met_reading] [int] NULL,
[met_number] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[met_is_active] [bit] NOT NULL CONSTRAINT [df_met_is_active] DEFAULT ((1)),
CONSTRAINT [pk_met_id] PRIMARY KEY CLUSTERED
(
[met_id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF)
)

Each article hangs from the job table which in turn hangs from the sys_user table

joins to get there are as follows

-- Select the technician information
SELECT <published_columns> FROM [dbo].[sys_user] WHERE syu_code = SUSER_SNAME() AND syu_is_active = 1

-- select the jobs for the technician
SELECT <published_columns> FROM [dbo].[sys_user] INNER JOIN [dbo].[job] ON sys_user.syu_id = job.job_syu_id AND job.job_is_active = 1

-- select the job travel records for each job
SELECT <published_columns> FROM [dbo].[job] INNER JOIN [dbo].[job_travel] ON job.job_id = job_travel.jot_job_id AND job_travel.jot_is_active = 1

-- select the meter records for each job
SELECT <published_columns> FROM [dbo].[job] INNER JOIN [dbo].[meter] ON job.job_id = meter.met_job_id AND meter.met_is_active = 1

MSmerge conflict info for job_travel (3 useful columns - let me know if you need more)
conflict_type reason_code reason_text
2 2 The same column(s) of the same row was updated at both '25a - 1193b9285dee' and 'mas.canon_map'. The resolver chose the update from '25a - 1193b9285dee' as the winner.

A typical job_travel record from the conflict table

jot_id jot_guid jot_job_id jot_travel_start jot_travel_stop jot_travel_duration jot_is_active origin_datasource_id
5ED06CA2-C513-46EE-BA52-A7CD7327D195 A8243A8C-0316-DB11-807E-00145E2A163D 95BFBB97-694E-4526-8FBE-7D31CB35251C 2006-07-18 14:18:00.000 NULL NULL 1 1CEA745B-FAF4-4772-A5D1-3E644DD40874

MSmerge conflict info for meter (3 useful columns - let me know if you need more)

conflict_type reason_code reason_text
2 2 The same column(s) of the same row was updated at both '73w - e17b9ff3c3eb' and 'mas.canon_map'. The resolver chose the update from '73w - e17b9ff3c3eb' as the winner.

A typical meter record from the conflict table
met_id met_guid met_job_id met_reading met_number met_is_active origin_datasource_id
127380E3-E1AF-49BD-8B6C-FB5338287CDD F2D5A09B-0C15-DB11-807E-00145E2A163D 7594C31D-1805-46B8-B2A8-F1EDB46E8C06 NULL 1 1 1CEA745B-FAF4-4772-A5D1-3E644DD40874

<quote>
Also, there are probably some information about conflict in merge agent history
</quote>

Not sure what you're looking for here?

<quote>

Do you have some primary key, foreign key constraint on publisher only?

</quote>


No, constraints are consistent at both publisher and subscriber.

<quote>

Do

you have join filters defined in your publication?
</quote>


Yes, as shown above

<quote>

when you do update,

do you update the rows on both base article and join article?
</quote>

potentially.

Sometimes we will and sometimes we won't. Information on a meter or a job_travel record may change without any change to the job data. A meter or job_travel change does not force a change to the job record.

To re-iterate to data flow.

A record gets create at the publisher.
Synchronisation ensures the subscriber has access to the record.
A data update occurs at the subscriber. (job_travel.jot_travel_stop) (meter.met_reading)
NO data updates occur at the publisher.
Synchronsation ensures the change goes from the subscriber to the publisher.
On some occasions - not all - a conflict occurs.
The custom resolver (subscriber always wins) kicks in and resolves the data - EVENTUALLY. There is a definite delay in this process causing the data extract that has been triggered to extract unresolved data (publisher data before the update)

Hopefully this is sufficient information for you to continue with. Ask for more and I'll see what I can provide.

Friday, 24 February 2012

Conflict tables

Hello,
We are creating merge replication.
Is there any way to make the conflict tables to be create
in another database then the publisher database?
or to move them after creation.
Many Thanks for reply.
No, I don't think the conflict tables can be moved.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"DIRYU" <anonymous@.discussions.microsoft.com> wrote in message
news:653f01c49336$0acd99e0$a301280a@.phx.gbl...
> Hello,
> We are creating merge replication.
> Is there any way to make the conflict tables to be create
> in another database then the publisher database?
> or to move them after creation.
>
> Many Thanks for reply.

Conflict tables

Hello,
We are creating merge replication.
Is there any way to make the conflict tables to be create
in another database then the publisher database?
or to move them after creation.
Many Thanks for reply.No, I don't think the conflict tables can be moved.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"DIRYU" <anonymous@.discussions.microsoft.com> wrote in message
news:653f01c49336$0acd99e0$a301280a@.phx.gbl...
> Hello,
> We are creating merge replication.
> Is there any way to make the conflict tables to be create
> in another database then the publisher database?
> or to move them after creation.
>
> Many Thanks for reply.

Conflict table cleanup

Hello All -
Is there a process that automatically cleans the conflict tables?
I have a merge publication with publisher & distributer running on same
machine. This is SQL 2K and W2K host. The clients are push subscription.
I viewed several conflicts last week ( Friday) and postponed resolving them.
There were about 300 conflicts and I didn't view them all.
Today when I went to view them, EM told me that 'no conflicts table'.
Is there some automatic clean of the conflict tables?
Do conflicts get purged when re-initializing all client?
Thanks,
bruce
Yes we do cleanup the rows when the subscription is re-initialized, also
the conflict rows are deleted when we manually resolve it from the conflict
resolver.
thanks
gopal
|||Bruce,
This is not a cleanup, but a wipe out! Your problem could be related to the
fact that the Snapshot Agent may be running automatically.
Everytime this agent runs the conflict tables are dropped and recreated
(they say this is by design), therefore you will lose any conflicts that
were there before.
Raj Moloye

Conflict Resolution: Is defining local subscription enough: How to get log of lost record.

Publisher always wins is the default, so you don't need
to do anything to achieve this.
To get notification of a conflict, you could create a
polling routine (there's no alert that I know of).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
hi Paul,
Thanks for you reply, I have few more queries
1. Where is this conflict information specially the losing row information is stored, at the publisher side or at the subscriber side? if losing row information is maintained at the publisher side is there any way so that we can store this information at the publisher side.
2. As you talked about creating a polling routine to get notification of conflict, in my implementation I just want a log file which contain information about the losing row nothing else, will the polling routine you are referring to can do the same and alsoI have not much information about how to write polling routine can you throw some light on it?
regards.
Ruchir.

Quote:

Originally posted by Paul Ibison
Publisher always wins is the default, so you don't need
to do anything to achieve this.
To get notification of a conflict, you could create a
polling routine (there's no alert that I know of).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

|||Have a look at the tables
conflict_<PublicationName>_<ArticleName>_usertable name
and
MSmerge_delete_conflicts
at the publisher.
The polling routine would be not much more than a job
that runs regularly and does a select from this table,
then sends the results in an email as an attachment. The
origin_datasource column could be used to determine the
correct recipient.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Conflict resolution for Transactional Replication with Updating Subscribers

Hi.
I'm trying to establish whether Transactional Replication with
Updating Subscribers meets my requirements. I have chosen to use
"publisher wins" for the conflict resolution. (I'm using SqlServer
2005 Developer Edition on Win XP SP2 on both machines)
When I cause a conflict to occur by making an update to rows with the
same PK on both servers, the publisher indicates that there has been a
conflict, and that it chose the publisher as the winner. However, the
losing transaction on the subscriber does not seem to be rolled back
like this article says it should: http://msdn2.microsoft.com/en-us/library/ms151177.aspx.
I'm then left in the state where the two tables are out of sync.
Any ideas anyone?
Cheers!
Some extra info...
I forgot to mention earlier that I'm using a push subscription.
I've found that if I choose 'subscriber-wins' instead, then it seems
to work OK, but unfortunately this is not what I require.
'Normal' changes to data on both servers are correctly replicated to
the other server. It's just publisher-wins conflict resolution that
doesn't seem to work. The conflict is detected, but the publisher's
data is not applied to the subscriber (i.e. the subscriber change is
not rolled back).. Any further changes to that row fail to go through
following the conflict.
Any comments appreciated,
Rich.
On 23 Feb, 08:22, ricisb...@.yahoo.co.uk wrote:
> Hi.
> I'm trying to establish whether Transactional Replication with
> Updating Subscribers meets my requirements. I have chosen to use
> "publisher wins" for the conflict resolution. (I'm using SqlServer
> 2005 Developer Edition on Win XP SP2 on both machines)
> When I cause a conflict to occur by making an update to rows with the
> same PK on both servers, the publisher indicates that there has been a
> conflict, and that it chose the publisher as the winner. However, the
> losing transaction on the subscriber does not seem to be rolled back
> like this article says it should:http://msdn2.microsoft.com/en-us/library/ms151177.aspx.
> I'm then left in the state where the two tables are out of sync.
> Any ideas anyone?
> Cheers!

conflict Problem Help

Hello Everybody
I am having merge Replication using MSSQL 2000 sp3 latest security patch,
My replication is server1 Publisher, server2 subscriber, server3
subscriber,
Server4 subscriber, server5 subscriber. I am using schedule around 1:00
AM every day, In Server2 we insert 5 rows some value, and 5 rows sending to
Server3 using DTS with Insert statement, and server3 we update the 5Rows,
and sending to Server4 or server2, this all process everything done before
synchronize. I am using default conflict revolver, becoz some table dont
have date time field. When I run the merge agent, I got some conflict in
conflict tables. Automatically delete some row in subscriber.
How to resolve those problems. I need urgent help.
The same row was updated at 'THSWPSW002.GCP' and deleted at
'BKKNTS370.GCPTEST'.
The resolver chose the deletion as the winner.
3:3 conflict_type : reason_code
The same column(s) of the same row was updated at both 'SERVER1.APPTEST' and
' SERVER2.APPTEST '.
The resolver chose the update from ' SERVER1.APPTEST ' as the winner.
2:2
The row was inserted at ' SERVER5.APPTEST ' but could not be inserted at '
SERVER1.APPTEST '. Violation of PRIMARY KEY constraint
'PK__T_M_SUPPLIER__3607E224'. Cannot insert duplicate key in object
'T_M_SUPPLIER'.
5:2627
The row was inserted at 'SERVER1.APPTEST' but could not be inserted at
'SERVER2.APPTEST'. Violation of PRIMARY KEY constraint
'PK__T_M_SUPPLIER__38CF4036'. Cannot insert duplicate key in object
'T_M_SUPPLIER'.
6:2627
The same row was updated at both 'SERVER1.APPTEST' and 'SERVER5.APPTEST'.
The resolver chose the update from 'BKKNTS370.GCPTEST' as the winner.
1:1
Thanks
Sam
Sam,
please take a look at this article and see if it applies:
http://support.microsoft.com/default...&Product=sql2k
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks,
Still i have problem some conflict.
i change mergearticle error 'flase'
could you tell me how to handule ?
Sam
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ui2754ILGHA.2276@.TK2MSFTNGP15.phx.gbl...
> Sam,
> please take a look at this article and see if it applies:
> http://support.microsoft.com/default...&Product=sql2k
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>

Tuesday, 14 February 2012

Configuring new Subscriber. Publisher can't connect to Subscriber

Hi,
Both the publisher and subscriber are SQL 2005 SP2. I am trying to set up a
new subscriber to a push replication. I have other subscribers that are
working fine. When I try to add a new subscriber I am specifying the
computers name as the 'Server Name'. When the wizzard attempts to connect I
receive an error specifying that 'Cannot connect to XXXXX'. 'Timout expired.
The timeout period elapsed prior to completion of hte operation or the
server is not responding. (Microsoft SQL Server). Is these something that I
need configured on the subscriber machine? I'm sure I am missing something
obvious.
Thanks for your help,
Terry
its hard to say what is the problem here. Set the login timeout to something
large, perhaps 300. Enable logging to see if you can see where it is getting
stuck.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Terry Wahl" <TerryWahl@.discussions.microsoft.com> wrote in message
news:78D0CB4F-5EFA-4D15-B13B-8F54F8D1BF2C@.microsoft.com...
> Hi,
> Both the publisher and subscriber are SQL 2005 SP2. I am trying to set up
> a
> new subscriber to a push replication. I have other subscribers that are
> working fine. When I try to add a new subscriber I am specifying the
> computers name as the 'Server Name'. When the wizzard attempts to connect
> I
> receive an error specifying that 'Cannot connect to XXXXX'. 'Timout
> expired.
> The timeout period elapsed prior to completion of hte operation or the
> server is not responding. (Microsoft SQL Server). Is these something
> that I
> need configured on the subscriber machine? I'm sure I am missing
> something
> obvious.
> Thanks for your help,
> Terry
|||Hi Hilary,
Thanks for the reply. It turns out that the firewall was the issue. Here
is the document that I used to configure the firewall:
http://msdn2.microsoft.com/en-us/library/ms175043(SQL.90).aspx
Thanks again,
Terry
"Hilary Cotter" wrote:

> its hard to say what is the problem here. Set the login timeout to something
> large, perhaps 300. Enable logging to see if you can see where it is getting
> stuck.
> --
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Terry Wahl" <TerryWahl@.discussions.microsoft.com> wrote in message
> news:78D0CB4F-5EFA-4D15-B13B-8F54F8D1BF2C@.microsoft.com...
>
>

Sunday, 12 February 2012

Configure web synchronization wizard error

I am trying to confugure SQL Server 2005 (wrokgroup edition) for merge
replication with web synchronisation. The server will be publisher and
distributor and the remote client will be running SQL Server 2005
Express.
I have set up two directories under Inetpub on the server. The access
directory is set up as a virtual directory for web access and the
snapshot directory is set up as a network share.
I have set up a local account for replication / synchronization.
The SQL Agent runs under the admin account, I have logged on to SQL
management studio under the admin account and created the publication.
When I run the configure web synchronisation wizard I keep getting an
error occuring when it gets to the step "Setting the snapshot share
permissions" which then rolls back the previous actions.
A message comes up for each user I have specified (three in the last
case) saying "Setting the snapshot share permissions (error)" and then
"The operation completed successfully. (Exception from HRESULT:
0x8007) (mscorlib)" for each user.
I have tried manually configuring both directories for permissions for
all three accounts (admin account running SQL agent, local account for
replication/synchronisationand login on remote client). Starting to
clutch at straws!
Any help greatly appreciated. It appears to be something to do with
permissions but I am not sure what to set for which account and where.
Many thanks.
On 1 Jun, 10:37, JDS <a...@.jeremysage.com> wrote:
> I am trying to confugure SQL Server 2005 (wrokgroup edition) for merge
> replication with web synchronisation. The server will be publisher and
> distributor and the remote client will be running SQL Server 2005
> Express.
>...
> A message comes up for each user I have specified (three in the last
> case) saying "Setting the snapshot share permissions (error)" and then
> "The operation completed successfully. (Exception from HRESULT:
> 0x8007) (mscorlib)" for each user.
>
I think problem solved but just in case anyone else comes across the
same thing (I have seen a few similar post with no resolution) the
change that seemed to make the difference was the specification of the
location of the snapshot folder. I clicked on the "Browse..." button
to specify the location but this does not seem to insert the correct
reference - it gives the full path - I changed this to //ServerName/
ShareName and the wizard complete OK.
I hope this was of use to someone.