Skip to content

2.27.0.0-b242

@myang2021 myang2021 tagged this 18 Jun 23:18
Summary:
This diff makes some more changes to improve logging incremental catalog cache
refresh to debug some full catalog refreshes that were performed unexpectedly.

(1) add an atomic debug_id that is passed to both
`SetYsqlDBCatalogVersionsUnlocked` and `SetYsqlDBCatalogInvalMessagesUnlocked`
when they are called atomically.
(2) add MyDatabaseId to the PG log that indicates full/incremental catalog cache
refresh
(3) Fixed a few indentations
(4) Removed a `if (catalog_changed)` test because of the if (!catalog_changed)`
a few lines test earlier.
(5) Added a few `EXCLUDES(lock_)` and `GUARDED_BY(lock_)` for better thread safety check.
(6) set `--log_ysql_catalog_versions=true` for catalog invalidation message tests
Jira: DB-16921

Test Plan:
./yb_build.sh release --cxx-test pg_catalog_version-test

Look at the new test logs:

PG:
```
[ts-1] 2025-06-17 18:51:26.336 UTC [1168130] LOG:  calling YBRefreshCache: 0 1 2 0 1 0 4 for database 13515
```

yb-tserver:
```
[ts-2] I0617 19:59:04.035523 1283036 tablet_server.cc:1428] SetYsqlDBCatalogVersionsUnlocked: set db 13515 catalog version: 257, breaking version: 1, debug_id: 57
[ts-2] I0617 19:59:04.035606 1283036 tablet_server.cc:1705] appending version 253, message_list: 120, db 13515, debug_id: 57
[ts-2] I0617 19:59:04.035622 1283036 tablet_server.cc:1705] appending version 254, message_list: 120, db 13515, debug_id: 57
[ts-2] I0617 19:59:04.035630 1283036 tablet_server.cc:1705] appending version 255, message_list: 120, db 13515, debug_id: 57
[ts-2] I0617 19:59:04.035642 1283036 tablet_server.cc:1705] appending version 256, message_list: 120, db 13515, debug_id: 57
[ts-2] I0617 19:59:04.035651 1283036 tablet_server.cc:1705] appending version 257, message_list: 120, db 13515, debug_id: 57
[ts-2] I0617 19:59:04.035665 1283036 tablet_server.cc:1711] queue size: 256, debug_id: 57
```

Reviewers: kfranz, sanketh, mihnea

Reviewed By: kfranz

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D44844
Assets 2
Loading