在事务复制订阅者上打开延迟持久性是否安全?

Is it safe to turn on Delayed Durability on a transaction replication subscriber?

在事务复制环境中,发布者 SQL 服务器从应用程序接收频繁的插入和更新,而订阅者 SQL 服务器具有拉式复制作业,启用延迟持久性是否安全订户?

Microsoft says that delayed durability is not supported for transaction replication,但不清楚这是与复制中涉及的任何服务器有关,还是仅与发布者有关。

虽然开启延迟持久性总是存在风险,但为复制订阅者开启它是否会增加风险?如果不受支持或存在额外风险,是否有办法减少 WRITELOG 对订阅者的等待?订阅者是一个报告服务器,它的第一个等待始终是 WRITELOG,因为应用程序经常在发布者上进行插入和更新(345.1 小时的正常运行时间中有 45.3 小时的 WRITELOG 等待)。

首先谁在乎呢? WRITELOG 等待是由分发代理而不是用户遭受的。

其次,您是否考虑过普通复制性能优化,即Enhance Transactional Replication Performance, in particular Subscription Streams

The –SubscriptionStreams parameter can greatly improve aggregate replication throughput. It allows multiple connections to a Subscriber to apply batches of changes in parallel, while maintaining many of the transactional characteristics present when using a single thread. If one of the connections fails to execute or commit, all connections will abort the current batch, and the agent will use a single stream to retry the failed batches. Before this retry phase completes, there can be temporary transactional inconsistencies at the Subscriber. After the failed batches are successfully committed, the Subscriber is brought back to a state of transactional consistency.

并行写入订阅者将提高复制吞吐量应该减少聚合 WRITELOG 等待,因为并发事务可以在每个日志文件 IO 上进行。

当然不支持,因为分发服务器在失败后不知道订阅服务器的正确状态。因此,在计划外关机后,您会丢失数据,并且不会有任何其他迹象。您基本上必须在任何失败后重新初始化订阅者。