{"action":"created","issue":{"url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/405","repository_url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core","labels_url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/405/labels{/name}","comments_url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/405/comments","events_url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/405/events","html_url":"https://github.com/Terracotta-OSS/terracotta-core/issues/405","id":196179180,"number":405,"title":"Entity creation event not send to M&M after a failover","user":{"login":"mathieucarbou","id":61346,"avatar_url":"https://avatars.githubusercontent.com/u/61346?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieucarbou","html_url":"https://github.com/mathieucarbou","followers_url":"https://api.github.com/users/mathieucarbou/followers","following_url":"https://api.github.com/users/mathieucarbou/following{/other_user}","gists_url":"https://api.github.com/users/mathieucarbou/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieucarbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieucarbou/subscriptions","organizations_url":"https://api.github.com/users/mathieucarbou/orgs","repos_url":"https://api.github.com/users/mathieucarbou/repos","events_url":"https://api.github.com/users/mathieucarbou/events{/privacy}","received_events_url":"https://api.github.com/users/mathieucarbou/received_events","type":"User","site_admin":false},"labels":[{"id":292339161,"url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/labels/bug","name":"bug","color":"fc2929","default":true},{"id":292339166,"url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"myronkscott","id":16088297,"avatar_url":"https://avatars.githubusercontent.com/u/16088297?v=3","gravatar_id":"","url":"https://api.github.com/users/myronkscott","html_url":"https://github.com/myronkscott","followers_url":"https://api.github.com/users/myronkscott/followers","following_url":"https://api.github.com/users/myronkscott/following{/other_user}","gists_url":"https://api.github.com/users/myronkscott/gists{/gist_id}","starred_url":"https://api.github.com/users/myronkscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myronkscott/subscriptions","organizations_url":"https://api.github.com/users/myronkscott/orgs","repos_url":"https://api.github.com/users/myronkscott/repos","events_url":"https://api.github.com/users/myronkscott/events{/privacy}","received_events_url":"https://api.github.com/users/myronkscott/received_events","type":"User","site_admin":false},"assignees":[{"login":"myronkscott","id":16088297,"avatar_url":"https://avatars.githubusercontent.com/u/16088297?v=3","gravatar_id":"","url":"https://api.github.com/users/myronkscott","html_url":"https://github.com/myronkscott","followers_url":"https://api.github.com/users/myronkscott/followers","following_url":"https://api.github.com/users/myronkscott/following{/other_user}","gists_url":"https://api.github.com/users/myronkscott/gists{/gist_id}","starred_url":"https://api.github.com/users/myronkscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myronkscott/subscriptions","organizations_url":"https://api.github.com/users/myronkscott/orgs","repos_url":"https://api.github.com/users/myronkscott/repos","events_url":"https://api.github.com/users/myronkscott/events{/privacy}","received_events_url":"https://api.github.com/users/myronkscott/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-12-16T23:51:09Z","updated_at":"2016-12-17T18:49:03Z","closed_at":null,"body":"When a failover occurs, @jd0-sag explained me (and hence I coded that) that addNode() calls are made on the new active with the PlatformEntity false isActive set to false (when replaying the tree), meaning that passive entities are added in the tree, then some addNode will be called again with this time PlatformEntity flag isActive set to true, when active entities will be created by the new active.\r\n\r\nThis works fine with passthrough. We receive for the same entity 2 addNode, first one with isActive=false (when replaying the tree) then second one (isActive=true) when new active entity is created.\r\n\r\nWith Galvan, this does not work.\r\n\r\nWe receive the replay, but we do not receive events after active entities are created.\r\n\r\nSo server crashes because we cannot record clients fetching entities that are not in the topology tree because we didn't receive any addNode() call for them.\r\n\r\n```\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [], platform)\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform], clients)\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform], entities)\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform, entities], org.terracotta.management.entity.management.client.ManagementAgentEntityManagementAgent)\r\n.monitoring.TopologyService - [0] serverEntityFailover(testServer1, PlatformEntity{isActive=false, typeName='org.terracotta.management.entity.management.client.ManagementAgentEntity', consumerID=2, name='ManagementAgent'})\r\n.monitoring.MonitoringServiceProvider - [2] onEntityDestroyed()\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform, entities], org.terracotta.management.entity.sample.client.CacheEntitypet-clinic/clients)\r\n.monitoring.TopologyService - [0] serverEntityFailover(testServer1, PlatformEntity{isActive=false, typeName='org.terracotta.management.entity.sample.client.CacheEntity', consumerID=4, name='pet-clinic/clients'})\r\n.monitoring.MonitoringServiceProvider - [4] onEntityDestroyed()\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform, entities], org.terracotta.management.entity.tms.client.TmsAgentEntityFailoverIT)\r\n.monitoring.TopologyService - [0] serverEntityFailover(testServer1, PlatformEntity{isActive=false, typeName='org.terracotta.management.entity.tms.client.TmsAgentEntity', consumerID=1, name='FailoverIT'})\r\n.monitoring.MonitoringServiceProvider - [1] onEntityDestroyed()\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform, entities], org.terracotta.management.entity.sample.client.CacheEntitypet-clinic/pets)\r\n.monitoring.TopologyService - [0] serverEntityFailover(testServer1, PlatformEntity{isActive=false, typeName='org.terracotta.management.entity.sample.client.CacheEntity', consumerID=3, name='pet-clinic/pets'})\r\n.monitoring.MonitoringServiceProvider - [3] onEntityDestroyed()\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform], state)\r\n.monitoring.TopologyService - [0] serverStateChanged(testServer1, PASSIVE)\r\n.monitoring.IStripeMonitoringPlatformListenerAdapter - [0] addNode(testServer1, [platform], fetched)\r\n// we do not have additional addNode() with isActive=true, like Jeff explained me and like it is on passthrough\r\n```\r\n\r\nHere are the complete server logs with all M&M traces\r\n\r\n[server0.stdout.log.txt](https://github.com/Terracotta-OSS/terracotta-core/files/658506/server0.stdout.log.txt)\r\n\r\n[server1.stdout.log.txt](https://github.com/Terracotta-OSS/terracotta-core/files/658507/server1.stdout.log.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/comments/267779809","html_url":"https://github.com/Terracotta-OSS/terracotta-core/issues/405#issuecomment-267779809","issue_url":"https://api.github.com/repos/Terracotta-OSS/terracotta-core/issues/405","id":267779809,"user":{"login":"myronkscott","id":16088297,"avatar_url":"https://avatars.githubusercontent.com/u/16088297?v=3","gravatar_id":"","url":"https://api.github.com/users/myronkscott","html_url":"https://github.com/myronkscott","followers_url":"https://api.github.com/users/myronkscott/followers","following_url":"https://api.github.com/users/myronkscott/following{/other_user}","gists_url":"https://api.github.com/users/myronkscott/gists{/gist_id}","starred_url":"https://api.github.com/users/myronkscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myronkscott/subscriptions","organizations_url":"https://api.github.com/users/myronkscott/orgs","repos_url":"https://api.github.com/users/myronkscott/repos","events_url":"https://api.github.com/users/myronkscott/events{/privacy}","received_events_url":"https://api.github.com/users/myronkscott/received_events","type":"User","site_admin":false},"created_at":"2016-12-17T18:49:03Z","updated_at":"2016-12-17T18:49:03Z","body":"I believe what you describe is the desired sequence.  I'll look into why the correct sequence is not being reported as soon as possible."}}
{"actor":{"display_login":"myronkscott"}}