Extend trace record for COMMIT/ROLLBACK RETAINING to allow chaining of transaction ids [CORE6095] #6344
Submitted by: @pcisar
After commit\rollback retaining transaction has a new number (but only when there are any changes to the database). This significantly complicates analysis of trace reports, as it's not easy to link events to the transaction context as transaction may change identity.
It would be nice if trace entry for COMMIT/ROLLBACK RETAINING events would include both: original (or previous) transaction ID and new transaction ID, so trace log parsers could properly link events to transactions and retaining transactions into a chain.
The text was updated successfully, but these errors were encountered:
Commented by: @hvlad
I going to commit following changes:
a) transaction identifier could now contain optional "initial transaction number":
(TRA_1060843, INIT_1060842, CONCURRENCY | WAIT | READ_WRITE)
here TRA_1060843 is a current transaction number 1060843 and INIT_1060842 shows that initial transaction number was 1060842
Note, if transaction was never commited\rolled back with retaining option, its initial number is equal to the current one.
b) COMMIT_RETAINING and ROLLBACK_RETAINING events reports old transaction identifier and appends line with new transaction number:
2019-07-08T23:26:33.3550 (16220:00000000388A0040) COMMIT_RETAINING
here "(TRA_1060844, CONCURRENCY | WAIT | READ_WRITE)" is old transaction identifier, as it reported in events before COMMIT_RETAINING, and
After such "commit\rollback retaining" event transaction identifier will be reported appended with its initial number:
2019-07-08T23:26:37.0390 (16220:00000000388A0040) EXECUTE_STATEMENT_FINISH
2019-07-08T23:27:03.5050 (16220:00000000388A0040) COMMIT_RETAINING
and so on.