Summary:
Transactions that fail with a serialization error (SQLSTATE 40001) can be difficult to diagnose without knowing the context in which they were run. Support engineers and users frequently need to manually query for the transaction isolation level to understand the failure mode and potential for automatic retries.
This commit enhances the error message for serialization failures to provide this context directly. The DETAIL portion of the error report is now augmented with the transaction's isolation level (e.g., READ COMMITTED, REPEATABLE READ).
This change makes serialization errors more self-descriptive, improving the user experience and reducing the time required for support to diagnose and resolve related issues.
Example error message after this change:
```
ERROR: could not serialize access due to concurrent update
DETAIL: 2b6ce74e-bf21-473e-bba3-fc607d0d73a3 conflicts with... [repeatable read]
```
Fixes #28114
Jira: DB-17749
Test Plan:
Jenkins
Backport-through: 2024.2
Reviewers: pjain
Reviewed By: pjain
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D45780