Replication is always generating conflicts when replicating to the same machine

31 views
Skip to first unread message

Dominic Zukiewicz

unread,
Sep 22, 2014, 1:35:01 PM9/22/14
to rav...@googlegroups.com
I'm having problems with conflicting documents when demonstrating replication on the same server:

- Server & Client build = #2916.

Here are my steps to reproduce:

1. Generate a new database called "Sample" with the replication bundle
2. Create the sample database example
3. Create a new database called "SampleReplication" with the replication bundle

Then configure the Sample to replicate to the SampleReplication

1. Navigate to Sample database
2. Click Settings
3. Click Replication
4. In URL type - http://localhost:8080 
5. In the database, type 'SampleReplication'
6. Click Save

(Just to be clear, I am replicating to another database on the same machine. This is intentional for demonstration purposes).

Now, go to the Sample database, and edit a document:

1. Search for 'companies/1'
2. Change the Name to 'ABCDEFG'
3. Click Save
4. Now, navigate to the SampleReplication
5. Search for 'companies/1'

I get an error about replication - here are the 3 documents involved:

// Data
// Id = Raven/Replication/Sources/http://mycomputer:8081/databases/Sample
{
  "LastDocumentEtag": "01000000-0000-0006-0000-000000000006",
  "LastAttachmentEtag": "00000000-0000-0000-0000-000000000000",
  "ServerInstanceId": "b992d49c-b6c7-43ec-94c2-653690585822",
}
// Metadata
{}



// Data
// Id = companies/1/conflicts/974ad2bd-be50-40e1-ae6e-b667f9d690fa
{
 
"ExternalId": "ALFKI",
 
"Name": /*>>>> conflict start*/ [
   
"Alfreds Futterkiste",
   
"ABCDEF"
 
]/*<<<< conflict end*/,
 
"Contact": {
   
"Name": "Maria Anders",
   
"Title": "Sales Representative"
 
},
 
"Address": {
   
"Line1": "Obere Str. 57",
   
"Line2": null,
   
"City": "Berlin",
   
"Region": null,
   
"PostalCode": "12209",
   
"Country": "Germany"
 
},
 
"Phone": "030-0074321",
 
"Fax": "030-0076545"
}
// Metadata
{
  "Raven-Entity-Name": "Companies",
  "Raven-Clr-Type": "Orders.Company, Northwind",
  "Raven-Replication-Source": "http://mycomputer:8081/databases/Sample",
  "Raven-Replication-Conflict": "true"
}

// Data
// Id = companies/1/conflicts/974ad2bd-be50-40e1-ae6e-b667f9d690fa
{
  "ExternalId": "ALFKI",
  "Name": "Alfreds Futterkiste",
  "Contact": {
    "Name": "Maria Anders",
    "Title": "Sales Representative"
  },
  "Address": {
    "Line1": "Obere Str. 57",
    "Line2": null,
    "City": "Berlin",
    "Region": null,
    "PostalCode": "12209",
    "Country": "Germany"
  },
  "Phone": "030-0074321",
  "Fax": "030-0076545"
}
// Metadata
{
  "Raven-Entity-Name": "Companies",
  "Raven-Clr-Type": "Orders.Company, Northwind",
  "Raven-Replication-Source": "http://mycomputer:8081/databases/Sample",
  "Raven-Replication-Conflict": true
}

Question 1

Am I mis-configuring this somehow, or abusing a demo of replication?

Question 2

Please can I have guidance on how to solve this server side, without having to write a client API for it? 

The documentation does reference a code sample, but it would be helpful to have some info on fixing this from the IDE - especially if a code deployment was required

http://ravendb.net/docs/server/scaling-out/replication/handling-conflicts

Thanks

Dominic
 


Dominic Zukiewicz

unread,
Sep 22, 2014, 1:39:35 PM9/22/14
to rav...@googlegroups.com
I have not pasted the third document correctly - here it is:

// Data
//Id companies/1/conflicts/b992d49c-b6c7-43ec-94c2-653690585822
{
  "ExternalId": "ALFKI",
  "Name": "ABCDEF",
  "Contact": {
    "Name": "Maria Anders",
    "Title": "Sales Representative"
  },
  "Address": {
    "Line1": "Obere Str. 57",
    "Line2": null,
    "City": "Berlin",
    "Region": null,
    "PostalCode": "12209",
    "Country": "Germany"
  },
  "Phone": "030-0074321",
  "Fax": "030-0076545"
}
// Metadata
{
  "Raven-Entity-Name": "Companies",
  "Raven-Clr-Type": "Orders.Company, Northwind",
  "Raven-Replication-History": [],
  "Raven-Replication-Version": 4,
  "Raven-Replication-Source": "b992d49c-b6c7-43ec-94c2-653690585822",
  "Raven-Replication-Conflict-Document": true,
  "Raven-Replication-Conflict": true
}

Oren Eini (Ayende Rahien)

unread,
Sep 23, 2014, 5:23:38 AM9/23/14
to ravendb
Did you create the sample data in the 2nd db as well?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dominic Zukiewicz

unread,
Sep 23, 2014, 5:35:32 AM9/23/14
to rav...@googlegroups.com
No I didn't, it was just an empty DB. 

After creating it, I then set up replication on the Sample -> SampleReplication.

Happy to send a screen by screen of the process if that helps?

Oren Eini (Ayende Rahien)

unread,
Sep 23, 2014, 7:20:47 AM9/23/14
to ravendb
Build 2916

-> Create db r1(+replication)
-> Create sample data
-> Create db r2(+replication)
-> r1 replicates to r2

In db r1, go to "categories/1" and change name to be: BEVERAGES

Go to r2, see the document, works.

I tried it with a bunch of other docs as well.

Dominic Zukiewicz

unread,
Sep 23, 2014, 7:51:14 AM9/23/14
to rav...@googlegroups.com
Some additional configuration info for you, just to check the deployments:

- Raven.Server was downloaded via NuGet 
- Raven.Server was installed as a service from the installation directory
- It runs under port 8081 (8080 is reserved via IIS site)

I will run the Raven.Server as --debug and reproduce in a clean environment and attach the output in a new message.

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/9vbb0aOJUpc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Sep 23, 2014, 8:05:46 AM9/23/14
to ravendb
About the only thing that I can think that would result in this behavior is if the slave db already had the docs there.

Dominic Zukiewicz

unread,
Sep 23, 2014, 10:02:08 AM9/23/14
to rav...@googlegroups.com
Today - I cannot replicate it. I have re-created the steps and the replication is working as expected.

Feel free to close this issue, as I cannot replicate my own bug with my own steps :-/
Reply all
Reply to author
Forward
0 new messages