一个事务复制的bug--更新丢失 续
阅读本文之前请参考 最近又做了一个case,环境是sql server 2008 R2. 客户添加了一个'replication support only'的订阅,之后发现现存订阅出现了更新丢失。 丢失的数据恰巧是添加订阅前的几秒钟内生成的。 我开始以为是log reader没有开启造成的,检查了dist
阅读本文之前请参考
最近又做了一个case,环境是sql server 2008 R2. 客户添加了一个'replication support only'的订阅,之后发现现存订阅出现了更新丢失。 丢失的数据恰巧是添加订阅前的几秒钟内生成的。
我开始以为是log reader没有开启造成的,检查了distribution database的MSlogreader_history
,发现期间log reader并没有停止过。
如果Log reader停止,那么添加订阅前的更新肯定是丢失了。因为产生的数据的LSN小于"添加订阅"的LSN, 并且distribution agent把"添加订阅"的LSN先传递到了订阅。可是log reader一直处于运行状态,那么还有什么可能呢? 如果log reader的效率很低,,没有即时地将数据更新传递到distribution agent,那么也会产生这个问题吧?我想理论上是这样的,如果效率非常低,可以等同于log reader没有运行! 那么如何证明这一点呢?reproduce的过程可能会很复杂,而且客户的磁盘性能也很好…
我想到了另外一种可能,这个问题实际上和log reader的工作方式有关系:
当log reader启动后,会去读取publication database的日志,如果一次读取完后,如果publication database的日志中仍然有需要处理的数据,log reader会继续读;如果读取后没有数据需要处理,log reader会休息一段时间, 时间长度为PollingInterval的值(默认为5秒中)。 那么我们假设这样的情景。
PollingInterval为五秒。Log reader启动后发现没有数据需要读取,开始休息。
在第1秒的时候,其中的article a产生了数据更新
在第2秒的时候,其中的article b产生了数据更新
在第3秒的时候,添加了一个非snapshot方式初始化的订阅。
在第4秒的时候,其中的article c产生了数据更新
在第5秒的时候,其中的article d产生了数据更新
同时log reader开始继续扫描日志, 我们就会发现第一秒和第二秒的数据更新丢失了。
更多信息
1 向任意一个包含'replication support only' 订阅的发布添加article时都可能会导致这个发布库的所有发布的所有现存订阅出现更新丢失的问题。
向不包含'replication support only'订阅的发布添加不会有这个问题。
2 如果在添加一个'replication support only'的订阅时 ,该发布对应的发布数据库的所有已存在订阅也会出现更新丢失的情况,无论这些都订阅通过何种方式初始化,或属于那个发布。
解决方法之前文章介绍的相同
解决办法
===
升级至sql servr 2012
如果您暂时没有办法升级,可以采用以下两种方法:
添加一个新的发布,将新的article或订阅添加到发布中。
更多信息
========
1 向任意一个包含’replication support only’ 订阅的发布添加article时, 都可能导致这个发布库的所有发布的所有现存订阅出现更新丢失的问题。 向不包含’replication support only’订阅的发布添加article不会有这个问题。
2 如果在添加一个’replication support only’的订阅时 ,该发布对应的发布数据库的所有发布的所有已存在订阅都会受到影响,无论这些订阅是通过何种方式初始化,或属于哪个发布。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Blizzard Battle.net update keeps stuck at 45%, how to solve it? Recently, many people have been stuck at the 45% progress bar when updating software. They will still get stuck after restarting multiple times. So how to solve this situation? We can reinstall the client, switch regions, and delete files. To deal with it, this software tutorial will share the operation steps, hoping to help more people. Blizzard Battle.net update keeps stuck at 45%, how to solve it? 1. Client 1. First, you need to confirm that your client is the official version downloaded from the official website. 2. If not, users can enter the Asian server website to download. 3. After entering, click Download in the upper right corner. Note: Be sure not to select Simplified Chinese when installing.

We users should be able to understand the diversity of some functions when using this platform. We know that the lyrics of some songs are very well written. Sometimes we even listen to it several times and feel that the meaning is very profound. So if we want to understand the meaning of it, we want to copy it directly and use it as copywriting. However, if we want to use it, we still need to You just need to learn how to copy lyrics. I believe that everyone is familiar with these operations, but it is indeed a bit difficult to operate on a mobile phone. So in order to give you a better understanding, today the editor is here to help you. A good explanation of some of the above operating experiences. If you also like it, come and take a look with the editor. Don’t miss it.

Angular.js is a freely accessible JavaScript platform for creating dynamic applications. It allows you to express various aspects of your application quickly and clearly by extending the syntax of HTML as a template language. Angular.js provides a range of tools to help you write, update and test your code. Additionally, it provides many features such as routing and form management. This guide will discuss how to install Angular on Ubuntu24. First, you need to install Node.js. Node.js is a JavaScript running environment based on the ChromeV8 engine that allows you to run JavaScript code on the server side. To be in Ub

Lantern and Dungeons has been confirmed to be updated on February 29th. After the update, the remastered version of Lantern and Dungeons will be launched, and the remastered version will also be linked to the Legend of Nezha. The remastered version will also bring a new profession, and players can directly Job changes, dungeon content will also be expanded, new dungeon areas will be opened, etc. Mobile game update schedule Lantern and Dungeon updated on February 29th: Remastered version ╳ "Legend of Nezha" linkage version key content New profession, why are you invited to change jobs? Lamplighters can actually change jobs? Such cool equipment is really It makes people greedy. I heard that after changing jobs, the lantern holder can also learn many cool skills. Goro exclaimed: Thai pants are hot! The Legend of Nezha is coming together! Stepping on the hot wheel, holding the circle of heaven and earth in hand ♫ ~ The little heroes with both wisdom and courage: Nezha and Little Dragon Girl are about to come

A friend's computer has such a fault. When opening "This PC" and the C drive file, it will prompt "Explorer.EXE Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the project." Including folders, files, This computer, Recycle Bin, etc., double-clicking will pop up such a window, and right-clicking to open it is normal. This is caused by a system update. If you also encounter this situation, the editor below will teach you how to solve it. 1. Open the registry editor Win+R and enter regedit, or right-click the start menu to run and enter regedit; 2. Locate the registry "Computer\HKEY_CLASSES_ROOT\PackagedCom\ClassInd"

MSI graphics cards are the mainstream graphics card brand on the market. We know that graphics cards need to install drivers to achieve performance and ensure compatibility. So how to update the MSI graphics card driver to the latest version? Generally, MSI graphics card drivers can be downloaded and installed from the official website. Let’s find out more below. Graphics card driver update method: 1. First, we enter the "MSI official website". 2. After entering, click the "Search" button in the upper right corner and enter your graphics card model. 3. Then find the corresponding graphics card and click on the details page. 4. Then enter the "Technical Support" option above. 5.Finally go to “Driver & Download”

Windows updates may cause some of the following problems: 1. Compatibility issues: Some applications, drivers, or hardware devices may be incompatible with new Windows updates, causing them to not work properly or crash. 2. Performance issues: Sometimes, Windows updates may cause the system to become slower or experience performance degradation. This may be due to new features or improvements requiring more resources to run. 3. System stability issues: Some users reported that after installing Windows updates, the system may experience unexpected crashes or blue screen errors. 4. Data loss: In rare cases, Windows updates may cause data loss or file corruption. This is why before making any important updates, back up your

When Outlook has problems updating your inbox, it can affect productivity. This article will introduce some simple troubleshooting steps to help you solve the problem and get Outlook back to normal. Why is Outlook always stuck updating the inbox? Outlook may be stuck updating the inbox. Common reasons include network problems, excessive mailbox capacity, and the impact of anti-virus software or firewalls. Corrupted external plug-ins or data files can also cause this to happen. Next, we'll explore these possible causes in detail and provide solutions. Fix Outlook Stuck Updating Inbox If Outlook is unable to update your inbox, please refer to the solutions listed below: Restart Outlook Disabled
