Symptoms


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....

“The subscription does not exist” when a distributor primary replica fails over to a replica that does not use the same agent profile的更多相关文章

  1. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  2. RocketMQ 拉取消息-通信模块

    首先看server端:class NettyRemotingServer extends NettyRemotingAbstract implements RemotingServer 下面这个实现了 ...

  3. 再说rocketmq消息存储

    两篇精彩的文章: <RocketMQ源码 — 三. Producer消息发送过程> <RocketMQ源码解析:Message存储> rocketmq通过netty获取到消息请 ...

  4. rocketmq 问题

    1. 收不到消息-consumerOffset.json 信息错位 这种情况一般是,手动删除了store/commitlog目录里的数据等非常规手段造成了consumerOffset.json中记录的 ...

  5. Residential Gateway System for Home Network Service

    Disclosed herein is a Residential Gateway (RG) system for home network service. The RG system receiv ...

  6. COM Error Code(HRESULT)部分摘录

    Return value/code Description 0x00030200 STG_S_CONVERTED The underlying file was converted to compou ...

  7. RocketMQ 源码分析 —— Message 发送与接收

    1.概述 Producer 发送消息.主要是同步发送消息源码,涉及到 异步/Oneway发送消息,事务消息会跳过. Broker 接收消息.(存储消息在<RocketMQ 源码分析 —— Mes ...

  8. 【RocketMQ】消息的消费

    上一讲[RocketMQ]消息的拉取 消息消费 当RocketMQ进行消息消费的时候,是通过ConsumeMessageConcurrentlyService的submitConsumeRequest ...

  9. Django基础,Day2 - 编写urls,views,models

    编写views views:作为MVC中的C,接收用户的输入,调用数据库Model层和业务逻辑Model层,处理后将处理结果渲染到V层中去. polls/views.py: from django.h ...

随机推荐

  1. SpringMVC(三十) 实例:SpringMVC_RESTRUL_CRUD_显示所有员工信息

    Step by step to create a springMVC demo. 1. 创建一个dynamic web 工程. 2. 添加需要的jar文件,如下图: 3. 配置web.xml:配置di ...

  2. 杭电1024----Max Sum Plus Plus

    /* 这题还没有理解透彻.某个dalao也不写注释.只能自己理解了... 先求为i个元素(1<=i<=M)为一个区间的最大和,保证元素个数大于等于i个,递推到M个即可 借鉴原址:http: ...

  3. python基础一 ------装饰器的作用

    装饰器: 本质属性:为函数增加新功能的函数,只是有个语法糖,显得高大上而已 #装饰器 #引子 计算斐波那契数列,第50 项 import time def fibonacci(num): if num ...

  4. 浅析webpack使用方法

    webpack是一个网页模块打包工具,可以将所有代码.图片.样式打包在一起,除此之外还有许多实用的功能.最近看了一个慕课学习了一下webpack的使用,在这里做一下总结. 本文不会涉及太多深入的知识, ...

  5. 从零开始搭建一个从Win7环境备份至CentOS7的SVN双机备份环境

    ★几个关键的事项★ 需要关闭防火墙filewalld跟selinux ,在root用户下操作: [root@localhost svnRepos]# systemctl stop firewalld ...

  6. Maven创建项目

    Maven创建项目 Maven翻译成中文是『专家.内行』.Maven是Apache组织中一个颇为成功的开源项目,Maven主要服务于基于Java平台的项目构建.依赖管理和项目信息管理的优秀工具 本文将 ...

  7. WebApi路由解析增加版本控制

    1.自定义路由解析类 public class VersionHttpControllerSelector : IHttpControllerSelector { private const stri ...

  8. 【迎圣诞,拿大奖】+流量分析+Writeup分享

    太菜了太菜了,刚见到jsfuck时竟然不知道什么东西,自己都不敢说自己做过实验吧上的那道jsfuck题了. 进入正题: 首先解压发现两个文件,一个流量分析包,哇哇哇,我正好刚学了几天wireshark ...

  9. 导出使用NPOI

    调用: DataTable table = new DataTable(); #region 创建 datatable table.Columns.Add(new DataColumn("账 ...

  10. openstack 之~horizon部署

    第一:部署horizon环境: 安装部署memcache 安装软件包 yum install memcached python-memcached 启动memcache并且设置开机自启动 system ...