Failover Expectation

89 views
Skip to first unread message

Arnold Wolfe

unread,
Jul 24, 2014, 10:40:16 AM7/24/14
to rav...@googlegroups.com
Scenario:
  • We have two ravendb instances running in a master-master configuration
  • The application is currently running
  • The fail-over behavior is configured as AllowReadsFromSecondariesAndWritesToSecondaries
Here are the step we perform:
  1. Master A is stopped
  2. The application failover to Master B
  3. Restart the application

At this point the application does not work because it cannot find Master A.

Is that the expected behavior or do we have some configured incorrectly?

Arnold

Oren Eini (Ayende Rahien)

unread,
Jul 24, 2014, 10:48:12 AM7/24/14
to ravendb
No, it isn't right. We cache the topology locally.



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-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.

Chris Marisic

unread,
Jul 24, 2014, 12:38:29 PM7/24/14
to rav...@googlegroups.com
And by cache, Oren means to persistent storage.

Itamar Syn-Hershko

unread,
Jul 24, 2014, 1:37:09 PM7/24/14
to rav...@googlegroups.com
It is right and can definitely happen if your app went through a restart, as can happen on cloud services. I've raised this issue before.

--

Itamar Syn-Hershko
http://code972.com | @synhershko
Freelance Developer & Consultant

Oren Eini (Ayende Rahien)

unread,
Jul 25, 2014, 2:04:39 AM7/25/14
to ravendb
No, we are storing this data on disk, exactly for this scenario.

If you are running on the cloud, it is possible that you'll get what is effectively a brand new machine, but there isn't really a way to handle that in code.
To handle that, you need to specific the failover servers manually.

Itamar Syn-Hershko

unread,
Jul 25, 2014, 7:35:45 AM7/25/14
to rav...@googlegroups.com
There is, if RavenDB nodes would share this information between them and not rely on the client. Effectively giving them the notion of a cluster.

--

Itamar Syn-Hershko
http://code972.com | @synhershko
Freelance Developer & Consultant


Kijana Woodard

unread,
Jul 25, 2014, 8:23:57 AM7/25/14
to rav...@googlegroups.com
Barring a cluster, are there config settings for the client to inform it about failover servers? 

If so, what are they? Google let me down, but it's been a long night. :-)

Scott Vickers

unread,
Jul 25, 2014, 1:53:26 PM7/25/14
to rav...@googlegroups.com
I don't think those exists.  Seems like you should be able to provide more than one connection string, so the client automatically knows about them without relying on pinging the master.  Similar to how elasticsearch.net uses seed urls in the sniffing connection pool http://nest.azurewebsites.net/elasticsearch-net/cluster-failover.html

Oren Eini (Ayende Rahien)

unread,
Jul 26, 2014, 4:54:43 AM7/26/14
to ravendb
RavenDB doesn't do deep topologies. The assumption is that if you have A > B > C, then C is not relevant for clients (reporting, probably). Otherwise A > B & A > C.

Oren Eini (Ayende Rahien)

unread,
Jul 26, 2014, 4:56:09 AM7/26/14
to ravendb
Yes, in 3.0:

using (var store = new DocumentStore()
{
    Url = "http://localhost:59234", 
FailoverServers = new FailoverServers
{
ForDefaultDatabase = new[]
{
new ReplicationDestination { Url = "http://localhost:8078", ApiKey = "apikey"},
new ReplicationDestination { Url = "http://localhost:8077/", Database = "test", Username = "user", Password = "secret"}
},
ForDatabases = new Dictionary<string, ReplicationDestination[]>
{
{"Northwind", new []
{
new ReplicationDestination { Url = "http://localhost:8076"}
}
}
}
}
}.Initialize())

Oren Eini (Ayende Rahien)

unread,
Jul 26, 2014, 4:56:47 AM7/26/14
to ravendb
This exists:

<add name="FailoverServers" connectionString="Url = http://localhost:59233;Failover = {Url:'http://localhost:8078'};Failover = {Url:'http://localhost:8077/', Database:'test'}; Failover = Northwind|{Url:'http://localhost:8076/'};Failover={Url:'http://localhost:8075', Username:'user', Password:'secret'};Failover={Url:'http://localhost:8074', ApiKey:'d5723e19-92ad-4531-adad-8611e6e05c8a'}" />
Reply all
Reply to author
Forward
0 new messages