{
    "api_version": "1",
    "kind": "dse_post",
    "self": "https://update.dsesecurity.com/api/v1/posts/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
    "item": {
        "id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
        "slug": "dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery",
        "url": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
        "alternate_urls": {
            "markdown": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery.md",
            "json": "https://update.dsesecurity.com/api/v1/posts/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/"
        },
        "title": "Return the right state-change result from Service Fabric data-loss recovery",
        "summary": "What should a Service Fabric OnDataLossAsync implementation return after examining or restoring surviving state?",
        "format": {
            "slug": "guide",
            "name": "Guide"
        },
        "priority": {
            "slug": "info",
            "name": "Information"
        },
        "featured": false,
        "image": {
            "theme": "continuity-recovery",
            "label": "Continuity & recovery",
            "alt": "Paired infrastructure paths converging on a stable recovered service.",
            "card_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-card.webp?v=1.8.20",
            "hero_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-hero.webp?v=1.8.20",
            "social_url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
            "width": 2400,
            "height": 1350
        },
        "topics": [
            {
                "slug": "business-continuity",
                "name": "Business Continuity",
                "url": "https://update.dsesecurity.com/topic/business-continuity/"
            },
            {
                "slug": "it",
                "name": "IT",
                "url": "https://update.dsesecurity.com/topic/it/"
            }
        ],
        "author": {
            "name": "DSE Security Editorial Team",
            "url": "https://update.dsesecurity.com/#editorial-team",
            "type": "Organization"
        },
        "publisher": {
            "name": "Detection Systems & Engineering",
            "url": "https://dsesecurity.com/"
        },
        "published_at": "2026-09-10T00:31:41+00:00",
        "modified_at": "2026-09-10T00:32:00+00:00",
        "reviewed_on": "2026-09-09",
        "reading_minutes": 2,
        "word_count": 236,
        "potentially_affected": "Custom stateful Service Fabric services implementing OnDataLossAsync recovery handling.",
        "dse_recommendation": "DSE recommends making the handler's return value an explicit state-change contract.",
        "primary_source": {
            "name": "Azure Service Fabric disaster recovery - Azure Service Fabric | Microsoft Learn",
            "url": "https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery",
            "published_on": null,
            "authority": "Microsoft Learn"
        },
        "publishing_principles": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
        "usage_info": "https://update.dsesecurity.com/usage/",
        "copyright_notice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
        "content_html": "<h2>Source facts</h2>\n<p>Service Fabric calls OnDataLossAsync for suspected, not necessarily proven, data loss and chooses the remaining replica with the most progress. After examination and any restoration, the handler returns true if it changed state and false if it did not. A true result causes other remaining replicas to be dropped and rebuilt from that replica; false lets them retain their state. <a href=\"https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Learn</a>.</p>\n<h2>Applicability</h2>\n<p>Use this review for application-owned recovery code, not as permission to force system services out of quorum loss. Establish how the implementation decides whether state changed. Keep the decision to restore a backup separate from the meaning of the Boolean result.</p>\n<h2>DSE recommendation</h2>\n<p>DSE recommends making the handler&#8217;s return value an explicit state-change contract. Have the service owner review the paths for no change, successful restoration and incomplete investigation. Define how coordinated services will be checked before recovery is accepted, and preserve enough evidence to explain which state was selected. Do not return a success-looking value merely because the handler reached its final line.</p>\n<h2>Verification</h2>\n<p>In a disposable failure simulation, exercise both an unchanged surviving replica and a path that actually modifies state. Inspect the returned value and resulting handling of the remaining replicas. Verify application data and cross-service consistency after the test, not just replica availability. Record why the handler concluded that a change did or did not occur before approving the implementation.</p>\n<h2>Official references</h2>\n<p><a href=\"https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Learn</a>. Source retrieved September 9, 2026.</p>",
        "content_text": "Source facts\nService Fabric calls OnDataLossAsync for suspected, not necessarily proven, data loss and chooses the remaining replica with the most progress. After examination and any restoration, the handler returns true if it changed state and false if it did not. A true result causes other remaining replicas to be dropped and rebuilt from that replica; false lets them retain their state. Microsoft Learn.\nApplicability\nUse this review for application-owned recovery code, not as permission to force system services out of quorum loss. Establish how the implementation decides whether state changed. Keep the decision to restore a backup separate from the meaning of the Boolean result.\nDSE recommendation\nDSE recommends making the handler’s return value an explicit state-change contract. Have the service owner review the paths for no change, successful restoration and incomplete investigation. Define how coordinated services will be checked before recovery is accepted, and preserve enough evidence to explain which state was selected. Do not return a success-looking value merely because the handler reached its final line.\nVerification\nIn a disposable failure simulation, exercise both an unchanged surviving replica and a path that actually modifies state. Inspect the returned value and resulting handling of the remaining replicas. Verify application data and cross-service consistency after the test, not just replica availability. Record why the handler concluded that a change did or did not occur before approving the implementation.\nOfficial references\nMicrosoft Learn. Source retrieved September 9, 2026.",
        "content_markdown": "## Source facts\n\nService Fabric calls OnDataLossAsync for suspected, not necessarily proven, data loss and chooses the remaining replica with the most progress. After examination and any restoration, the handler returns true if it changed state and false if it did not. A true result causes other remaining replicas to be dropped and rebuilt from that replica; false lets them retain their state. [Microsoft Learn](https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery).\n\n## Applicability\n\nUse this review for application-owned recovery code, not as permission to force system services out of quorum loss. Establish how the implementation decides whether state changed. Keep the decision to restore a backup separate from the meaning of the Boolean result.\n\n## DSE recommendation\n\nDSE recommends making the handler’s return value an explicit state-change contract. Have the service owner review the paths for no change, successful restoration and incomplete investigation. Define how coordinated services will be checked before recovery is accepted, and preserve enough evidence to explain which state was selected. Do not return a success-looking value merely because the handler reached its final line.\n\n## Verification\n\nIn a disposable failure simulation, exercise both an unchanged surviving replica and a path that actually modifies state. Inspect the returned value and resulting handling of the remaining replicas. Verify application data and cross-service consistency after the test, not just replica availability. Record why the handler concluded that a change did or did not occur before approving the implementation.\n\n## Official references\n\n[Microsoft Learn](https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery). Source retrieved September 9, 2026."
    },
    "json_ld": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://dsesecurity.com/#organization",
                "name": "Detection Systems & Engineering",
                "alternateName": "DSE Security",
                "url": "https://dsesecurity.com/",
                "logo": {
                    "@type": "ImageObject",
                    "url": "https://update.dsesecurity.com/assets/dse-logo-20260812.png?v=1.8.20"
                }
            },
            {
                "@type": "Organization",
                "@id": "https://update.dsesecurity.com/#editorial-team",
                "name": "DSE Security Editorial Team",
                "url": "https://update.dsesecurity.com/",
                "parentOrganization": {
                    "@id": "https://dsesecurity.com/#organization"
                }
            },
            {
                "@type": "WebSite",
                "@id": "https://update.dsesecurity.com/#website",
                "name": "DSE Updates",
                "alternateName": "DSE Security Knowledge Hub",
                "url": "https://update.dsesecurity.com/",
                "inLanguage": "en-US",
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "potentialAction": {
                    "@type": "SearchAction",
                    "target": {
                        "@type": "EntryPoint",
                        "urlTemplate": "https://update.dsesecurity.com/?q={search_term_string}"
                    },
                    "query-input": "required name=search_term_string"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
                "url": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
                "isPartOf": {
                    "@id": "https://update.dsesecurity.com/#website"
                },
                "lastReviewed": "2026-09-09"
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/#breadcrumbs",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "DSE Updates",
                        "item": "https://update.dsesecurity.com/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Return the right state-change result from Service Fabric data-loss recovery",
                        "item": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/"
                    }
                ]
            },
            {
                "@type": [
                    "Article",
                    "TechArticle"
                ],
                "@id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/#article",
                "identifier": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
                "url": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/",
                "headline": "Return the right state-change result from Service Fabric data-loss recovery",
                "description": "What should a Service Fabric OnDataLossAsync implementation return after examining or restoring surviving state?",
                "abstract": "What should a Service Fabric OnDataLossAsync implementation return after examining or restoring surviving state?",
                "articleBody": "Source facts\nService Fabric calls OnDataLossAsync for suspected, not necessarily proven, data loss and chooses the remaining replica with the most progress. After examination and any restoration, the handler returns true if it changed state and false if it did not. A true result causes other remaining replicas to be dropped and rebuilt from that replica; false lets them retain their state. Microsoft Learn.\nApplicability\nUse this review for application-owned recovery code, not as permission to force system services out of quorum loss. Establish how the implementation decides whether state changed. Keep the decision to restore a backup separate from the meaning of the Boolean result.\nDSE recommendation\nDSE recommends making the handler’s return value an explicit state-change contract. Have the service owner review the paths for no change, successful restoration and incomplete investigation. Define how coordinated services will be checked before recovery is accepted, and preserve enough evidence to explain which state was selected. Do not return a success-looking value merely because the handler reached its final line.\nVerification\nIn a disposable failure simulation, exercise both an unchanged surviving replica and a path that actually modifies state. Inspect the returned value and resulting handling of the remaining replicas. Verify application data and cross-service consistency after the test, not just replica availability. Record why the handler concluded that a change did or did not occur before approving the implementation.\nOfficial references\nMicrosoft Learn. Source retrieved September 9, 2026.",
                "datePublished": "2026-09-10T00:31:41+00:00",
                "dateModified": "2026-09-10T00:32:00+00:00",
                "mainEntityOfPage": {
                    "@id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/"
                },
                "inLanguage": "en-US",
                "isAccessibleForFree": true,
                "author": {
                    "@type": "Organization",
                    "name": "DSE Security Editorial Team",
                    "url": "https://update.dsesecurity.com/#editorial-team"
                },
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "image": {
                    "@type": "ImageObject",
                    "@id": "https://update.dsesecurity.com/updates/dse-20260909-015-return-the-right-state-change-result-from-service-fabric-data-loss-recovery/#primaryimage",
                    "url": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
                    "contentUrl": "https://update.dsesecurity.com/assets/editorial/continuity-recovery-social-v2.jpg?v=1.8.20",
                    "width": 1200,
                    "height": 630,
                    "caption": "Return the right state-change result from Service Fabric data-loss recovery"
                },
                "articleSection": [
                    "Business Continuity",
                    "IT"
                ],
                "keywords": [
                    "Business Continuity",
                    "IT",
                    "Guide",
                    "Information priority"
                ],
                "genre": "Guide",
                "about": [
                    {
                        "@type": "Thing",
                        "name": "Business Continuity",
                        "url": "https://update.dsesecurity.com/topic/business-continuity/"
                    },
                    {
                        "@type": "Thing",
                        "name": "IT",
                        "url": "https://update.dsesecurity.com/topic/it/"
                    }
                ],
                "wordCount": 236,
                "timeRequired": "PT2M",
                "publishingPrinciples": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
                "usageInfo": "https://update.dsesecurity.com/usage/",
                "copyrightHolder": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "copyrightNotice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
                "citation": {
                    "@type": "CreativeWork",
                    "name": "Azure Service Fabric disaster recovery - Azure Service Fabric | Microsoft Learn",
                    "url": "https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-disaster-recovery"
                }
            }
        ]
    }
}