Problem with master-master replica

90 views
Skip to first unread message

luca.be...@gmail.com

unread,
Oct 19, 2017, 11:23:22 AM10/19/17
to RavenDB - 2nd generation document database
Hi

I have 2 Ravendb server (Server Build #35221) configured in master-master replica (read from all servers and allow write to secondaries), with a DB used by a site on IIS WebServer.
In the web.config of the application , I've configured the connection string in this way  <add name="RavenDbConnection" connectionString="Url=https://ravendb1.local:8080;ApiKey=db_rw/v1vs0JVthBAl;Database=Web;Failover={Url:'https://ravendb2.local:8080',ApiKey:'db_rw/Eulr3jNgAe',Database:'Web'}" />.
To test failover I've created a firewall rule to block traffic direct to ravendb1; this solution works till I restart the application pool.
Start from that moment the application/web page cannot start, and I recive a timeout message with this error:

"Message: 
 Attempted to connect to master and all replicas have failed, giving up.
 There is a high probability of a network problem preventing access to all the replicas.
 Failed to get in touch with any of the 1 Raven instances.

Source: Raven.Client.Lightweight

System.InvalidOperationException: Attempted to connect to master and all replicas have failed, giving up.
There is a high probability of a network problem preventing access to all the replicas.
Failed to get in touch with any of the 1 Raven instances.
   at Raven.Client.Connection.ReplicationInformerBase`1.<ExecuteWithReplicationAsync>d__33`1.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\ReplicationInformerBase.cs:line 336
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Async.AsyncServerClient.<ExecuteWithReplication>d__172`1.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Abstractions.Util.AsyncHelpers.<>c__DisplayClass1_1`1.<<RunSync>b__0>d.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Abstractions\Util\AsyncHelpers.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Raven.Abstractions.Util.AsyncHelpers.RunSync[T](Func`1 task) in C:\Builds\RavenDB-Stable-3.5\Raven.Abstractions\Util\AsyncHelpers.cs:line 89
   at Raven.Client.Document.DocumentSession.Load[T](String id) in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Document\DocumentSession.cs:line 277
   at Web.Providers.RavenDb.Services.AttachmentsDbService.GetAttachmentById(Int32 attachmentId) in D:\TFS\agent\_work\33\s\Web\Web.Providers.RavenDb.Shared\Services\AttachmentsDbService.cs:line 22
   at Web.Documents.Site.Controllers.ImageController.GetImage(Int32 documentId, Imageparameters param, ApplicationsEnum app, Boolean watermark) in D:\TFS\agent\_work\33\s\Web\Web.Documents.Site\Controllers\ImageController.cs:line 70
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"

Oren Eini (Ayende Rahien)

unread,
Oct 19, 2017, 4:18:31 PM10/19/17
to ravendb
What is the output of:

http://ravendb1.local:8080/databases/Web/replication/topology

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

luca.be...@gmail.com

unread,
Oct 20, 2017, 5:54:10 AM10/20/17
to RavenDB - 2nd generation document database
Hi,
this is the output:

{
  "ClusterInformation": {
    "IsInCluster": false,
    "IsLeader": false,
    "WithClusterFailoverHeader": false
  },
  "Term": -1,
  "ClusterCommitIndex": -1,
  "HasLeader": false,
  "Destinations": [
    {
      "ClusterInformation": {
        "IsInCluster": false,
        "IsLeader": false,
        "WithClusterFailoverHeader": false
      },
      "Url": "http://ravendb2.local:8080",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": "REMOVED",
      "Database": "Web",
      "TransitiveReplicationBehavior": "Replicate",
      "SkipIndexReplication": false,
      "IgnoredClient": false,
      "Disabled": false,
      "AuthenticationScheme": null,
      "ClientVisibleUrl": null,
      "SpecifiedCollections": {},
      "ReplicateAttachmentsInEtl": false,
      "Humane": "http://ravendb2.local:8080 Web"
    }
  ],
  "Id": "Raven/Replication/Destinations",
  "ClientConfiguration": {
    "FailoverBehavior": "AllowReadsFromSecondariesAndWritesToSecondaries, ReadFromAllServers",
    "RequestTimeSlaThresholdInMilliseconds": null
  }
}

I've removed the ApiKey

Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Oct 22, 2017, 3:49:18 AM10/22/17
to ravendb
Okay, that seems okay.
Can you check what urls it is accessing.

To verify, the issue is when the primary node is down when you start the client, right?

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

luca.be...@gmail.com

unread,
Oct 23, 2017, 4:22:12 AM10/23/17
to RavenDB - 2nd generation document database
The problem occurs when node 1 is unavailable and I reboot the website's application pool.
The strange thing is that if I do not reboot the application pool, the site seems to work but after a while I get the same errors as the above.

Oren Eini (Ayende Rahien)

unread,
Oct 23, 2017, 7:44:13 AM10/23/17
to ravendb
Can you schedule some time tomorrow to go over this in Skype?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

luca.be...@gmail.com

unread,
Oct 23, 2017, 9:19:42 AM10/23/17
to RavenDB - 2nd generation document database
Yes, we can make a call from 10 (uct + 1) whenever you like.
Where can I send my skype id privately?

Oren Eini (Ayende Rahien)

unread,
Oct 23, 2017, 9:28:22 AM10/23/17
to ravendb
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages