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. Java数组实现循环队列的两种方法

    用java实现循环队列的方法: 1.添加一个属性size用来记录眼下的元素个数. 目的是当head=rear的时候.通过size=0还是size=数组长度.来区分队列为空,或者队列已满. 2.数组中仅 ...

  2. 最近24小时记录:虚拟机与Wireshark 2.0

    最近24小时记录:虚拟机与Wireshark 2.0   (1)虚拟机如果NAT模式而无法联网,需要检查实体机中VMware的NAT服务是否开启. (2)从Wireshark 2.0版本开始,Wire ...

  3. XamarinAndroid组件教程RecylerView适配器使用动画

    XamarinAndroid组件教程RecylerView适配器使用动画 为RecylerView使用RecylerViewAnimators组件中提供的适配器动画,需要使用RecyclerView类 ...

  4. Javascript你必须要知道的面试题

    1.使用 typeof bar === "object" 判断 bar 是不是一个对象有神马潜在的弊端?如何避免这种弊端? 使用 typeof 的弊端是显而易见的(这种弊端同使用 ...

  5. BZOJ.3165.[HEOI2013]Segment(李超线段树)

    BZOJ 洛谷 对于线段,依旧是存斜率即可. 表示精度误差一点都不需要管啊/托腮 就我一个人看成了mod(10^9+1)吗.. //4248kb 892ms #include <cstdio&g ...

  6. vs code配置c/c++调试环境+mingw+win10

    参考博客:https://blog.csdn.net/bat67/article/details/76095813 下载VScode和mingw和环境变量的配置 请参考上述的博客 附上我的task.j ...

  7. spring项目出现无法加载主类

    问题:eclipse总是运行之前的项目,新改变的项目内容,不运行.于是我想要是清理缓存,网上说project--->clean指定的项目就可以 但是clean后就无法加载主类了,项目上还出现了红 ...

  8. java输出格式-----System.out.printf()

    package com.lzc.test; public class Main { public static void main(String[] args) { // 定义一些变量,用来格式化输出 ...

  9. 解决 main(int argc, char** argv)这种情况下通过命令行传参,改为main函数里面给定参数。

    本文是原创文章,未经允许,请勿转载. 原来程序中是通过运行exe,然后加上参数,然程序运行起来的.也就是main(int argc, char** argv)这里是通过argv参数是从命令行 传过来的 ...

  10. sql 索引笔记--索引组织结构

    非聚集索引与聚集索引具有相同的 B 树结构,它们之间的显著差别在于以下两点: 基础表的数据行不按非聚集键的顺序排序和存储. 非聚集索引的叶层是由索引页而不是由数据页组成. 既可以使用聚集索引来为表或视 ...