Error:
There may be an inconsistent state in the distribution database: Dist_backup_lsn {00000030:000001ba:0004},dist_last_lsn {00000030:000001cd:0004}. Please execute "sp_repldone null, NULL, 0, 0, 1" and then execute sp_replflush. Please reinitialize all subscriptions to the publication. (Source: MSSQLServer, Error number: 18846)
The error comes from:
The first parameter is DIST_LAST_LSN and the second parameter is DIST_BACKUP_LSN
Where Dist_last_lsn comes from table msrepl_transactions, sp_msget_last_transaction through stored procedure @publisher_id = 9, @publisher_db = N ' Db_test ' , @for_truncate = 0x0 obtained
Dist_backup_lsn from table Msrepl_backup_lsns, sp_msget_last_transaction @publisher_id = 9 through stored procedures, @publisher_db = N ' Db_test ', @for_truncate = 0x1 Obtained
If you do a backup of the distribution database at this point, the value of Msrepl_backup_lsns will be modified to match the MSrepl_transactions value, and LogReader will continue to work.