[Deprecated] Begin LSN specified for replication log scan is invalid

Microsoft.SQLServer.2008.BeginLSNSpecifiedForReplicationLogscanInvalidRule (Rule)

Knowledge Base article:

Summary

Begin Log Sequence Number specified for replication log scan is invalid.

Causes

The log sequence number (LSN) stored in the distribution database replication tables is later than the LSN specified in the transaction log as the next to be read by the Log Reader Agent. This indicates that the data is inconsistent between the publisher and distributor and the Log Reader Agent process does not know which record to correctly read next. This situation could occur, if rows were manually deleted from the MSrepl_transactions replication table or if the distribution database has sync with backup enabled, but publication database was restored without ensuring consistency between the databases.

Some scenarios where this situation could occur:

Resolutions

Reinitialize all subscriptions for the affected transactional publication to ensure the data is in sync.

External

Strategies for Backing Up and Restoring Snapshot and Transactional Replication

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

No

Priority

Defines Alert Priority.

2

Severity

Defines Alert Severity.

2

Element properties:

TargetMicrosoft.SQLServer.2008.DBEngine
CategoryEventCollection
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityHigh
RemotableTrue
Alert Message
Begin LSN specified for replication log scan is invalid
{0}

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.2008.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2008.BeginLSNSpecifiedForReplicationLogscanInvalidRule" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" Enabled="false" ConfirmDelivery="true">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2008.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<PublisherName>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</PublisherName>
<EventNumber>18765</EventNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>2</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2008.BeginLSNSpecifiedForReplicationLogscanInvalidRule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/LoggingComputer$</SuppressionValue>
<SuppressionValue>$Data/PublisherName$</SuppressionValue>
<SuppressionValue>$Data/EventDisplayNumber$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>