Virtual Column TSN May be Incorrect

This article pertains only to customers who are sending the virtual column TSN to the target.

We have recently become aware of a bug in the LogMiner that sometimes causes the TSN field in the commit record to be presented incorrectly.  Since this value is used by the Loader to populate the value for the materialized (virtual) column TSN that means the TSN value the Loader is sending is incorrect.

While we discovered this in Rdb on Integrity we have no reason to believe it will not also happen on Alpha.   It is likely that this is a pretty old bug dating to at least May of 2011 with the release of Rdb 7.2.5.  It may in fact be older.

The TSN field in Rdb is a three-field structure.   The traditional portion (pre Rdb 7.0) is an unsigned 32-bit integer and is broken into two fields, bit 31 being used as an indicator.   This means that it can represent values up to ‭2,147,483,647‬.   Roughly think of this as two thousand million, a very large value.  The second field is a two byte structure that is stored on the page and is the same for all lines on the page.

The traditional portion of the TSNs in an Rdb database are allocated using the unsigned field in the database root called next TSN. Values can range from 0 to 2,147,483,647.   The problem occurs when the traditional TSN becomes larger than 2,147,483,647. This is the largest value that can be stored in a 31-bit integer.   Incrementing this value by anything will cause the higher order bit to be set. This bit is used as a flag indicating that the page base TSN is to be invoked.  This adds another 16 bits to the 31 that are in the traditional field  for a total of 47 bits.  This extends the TSN to hundreds of millions of millions of values.

What happens then is the LogMiner, somewhere, improperly interprets the unsigned integer as a signed integer and returns a negative value in the commit record for the transaction.  The Loader picks up this value and transmits it to the target.

Oracle is working on this issue.   Until they have provided a solution, JCC recommends that you do nothing.