Operational Defect Database

BugZero found this defect 648 days ago.

Microsoft SQL Server | 14737844

KB5017009 - FIX: sp_replmonitorsubscriptionpendingcmds returns incorrect pending commands for P2P replication - Microsoft Support

Last update date:

5/12/2023

Affected products:

SQL Server 2019 on Windows

SQL Server 2022 on Linux (all editions)

SQL Server 2022 on Windows (all editions)

Affected releases:

build lower than 15.0.4249.2

Fixed releases:

15.0.4249.2

Description:

Symptoms

The sp_replmonitorsubscriptionpendingcmds stored procedure is not compatible with peer-to-peer (P2P) replication. It returns an incorrect number of pending commands. After you apply this fix, sp_replmonitorsubscriptionpendingcmds will be compatible with P2P replication. Note The "Undistributed Commands" tab of a Replication Monitor invokes sp_replmonitorsubscriptionpendingcmds behind the scenes.

Resolution

Cumulative update information This problem is fixed in the following cumulative updates for SQL Server: Cumulative Update 2 for SQL Server 2022 Cumulative Update 17 for SQL Server 2019 Note After you apply this cumulative update, sp_replmonitorsubscriptionpendingcmds might still report an incorrect number of pending commands for P2P replication if the MSrepl_originators table contains stale entries. If the MSrepl_originators table contains stale entries, running sp_replmonitorsubscriptionpendingcmds will generate the following warning message in the SQL Server error log: Warning: Unable to get database version for the subscription database '<database_name>'. The sp_replmonitorsubscriptionpendingcmdsmay report the incorrect number of pending commands for P2P replication. To resolve this problem, either delete the stale entries from MSrepl_originators or pass the correct "dbversion" of a subscription database as a subdb_version argument when you run sp_replmonitorsubscriptionpendingcmds. Tips: You can select either of the following methods to find the "dbversion" of a subscription database: Run the following query on a distribution database:                                                                                        select dbversion from MSrepl_originatorswhere publisher_database_id = <Publisher_Database_ID>and srvname = <Subscriber_Server>and dbname = <Subscriber_Database>Note You need to substitute appropriate values for <Publisher_Database_ID> , <Subscriber_Server> and <Subscriber_Database>. Run the following query on a subscription database:                                                                                    declare @current_version int , @currentGuid uniqueidentifierselect @currentGuid = recovery_fork_guid from sys.database_recovery_statuswhere database_id = db_id()select @current_version = substring(convert(binary(16), isnull(@currentGuid, 0x0)),1,6)print @current_version

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References

Learn about the terminology that Microsoft uses to describe software updates.

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Unavailable

Learn More

Search:

...