예제 #1
0
        private async Task <byte[]> GetInitialFromLsnAsync(TableSchema tableSchema, byte[] lastProcessedLsn)
        {
            var minValidLsn = await _cdcRepository.GetMinValidLsnAsync(tableSchema.TableName);

            byte[] fromLsn = null;
            if (lastProcessedLsn == null)
            {
                fromLsn = minValidLsn;
            }
            else if (GetBigInteger(lastProcessedLsn) >= GetBigInteger(minValidLsn))
            {
                fromLsn = lastProcessedLsn;
            }
            else
            {
                fromLsn = minValidLsn;
                Console.WriteLine($"Table {tableSchema.TableName} - WARNING: The current minimum valid LSN for this table is later than the last processed LSN provided. Some data has been missed. Check your retention policy to help avoid this in future.");
            }

            return(fromLsn);
        }
예제 #2
0
 public async Task <byte[]> GetMinValidLsnAsync(string tableName)
 {
     return(await _cdcRepository.GetMinValidLsnAsync(tableName));
 }