惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
V
Visual Studio Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
月光博客
月光博客

博客园 - stswordman

Tutorial: Add a node to SQL cluster on RHEL Tutorial: Create SQL Cluster(FCI) on RHEL Configure multiple-subnet Always On Availability Groups and failover cluster instances by modifying CIB Failed to restart Polybase Data Movement service after running sp_polybase_join_group Realcase: Failed to upgrade SQL Server 2016 SP2 CU11. (Installation success or error status: 1648) Connect SQL Server from Linux Client using Windows Authentication and troubleshoot steps Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’ An example of polybase for Oracle use azure data studio to create external table for oracle Missing MSI and MSP files You may fail to backup log or restore log after TDE certification/key rotation. Password is required when adding a database to AG group if the database has a master key Use KTPASS instead of adden to configure mssql.keytab Failed to run 'create login' or 'sp_addsrvrolemeber' in sql Linux using windows authentcation Sql Server Linux(Redhat) Distributed Availability Group Setup — step by step Example of SQL Linux Windows Authentication configuration using Managed Service Accounts FILESTREAM feature can't be enabled if you use cluster shared volumes SQL Server does not purge row versioning records even the transaction are committed if there are other open transaction running in the databases with read-committed snapshot enabled . The thumbprint of same asymmetric key is not same in 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 and 'SQL Server Connector for Microsoft Azure Key
“The subscription does not exist” when a distributor prim...
stswordman · 2019-02-09 · via 博客园 - stswordman

Consider the following scenario:

  • In Microsoft SQL Server 2017, you have a distribution agent that does not use a default agent profile.
  • The distribution database is added to the availability group (AG).
  • The primary replica of the distribution database fails over to a replica that does not use the exact same agent profile.

In this scenario, the distribution agent fails, and you receive the following error message :

The subscription does not exist.

        
    
         

        

Cause


    

    
        
            

Agent profiles are managed and persisted in the msdb database. Changes to an agent profile are persisted in msdb and cannot be sent to other distributors in the distribution database AG.

Replication agents are associated with profile through profile_id. After a failover, the agent might be unable to find the correct profile. Alternatively, it might find the wrong profile. This is because a nondefault profile in one distributor could differ from that of another distributor, or it may never have existed, or it may have a different profile_id.

The distribution agent job issues the sp_MShelp_distribution_agentid stored procedure to get the agent ID when it starts. If the profile does not exist, or if the profile IDs are different, the distribution agent job does not get the agent ID, and it returns the "subscription does not exist" error message.

        
    
         

        

Workaround


    

    

To work around this issue, use one of the following methods.

Method 1 Specify the parameters in the distribution agent command directly, instead of using the agent profile. Also, apply the changes to the distribution agent job in all Distributor replicas.

Method 2 Make sure that the agent profile is created in all Distributors that are participating in the distribution database in the AG, and make sure that the profile IDs are the same.
The distribution agent runs the sp_MShelp_distribution_agentid stored procedure to get the agent profile. If the agent profile does not exist, or if the profile ID is different, the correct agent profile is not found, and the “The subscription does not exist” error message is returned.

To prevent this issue, specify the correct agent profile (profile ID) in the sp_MShelp_distribution_agentid stored procedure.

The following is a code segment of the sp_MShelp_distribution_agentid stored procedure:

select distribAgent.id , distribAgent.name , distribAgent.publisher_database_id , distribAgent.publisher_db , distribAgent.subscriber_db , profileName.profile_id , profileName.profile_name     from MSdistribution_agents as distribAgent       INNER JOIN msdb..MSagent_profiles as profileName       on distribAgent.profile_id = profileName.profile_id

https://support.microsoft.com/en-us/help/4488815/subscription-does-not-exist-when-distributor-primary-replica-fails

This is a design issue, may be addressed in further version....