You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
I found two logs that appear in high frequency when incremental cache refresh is
enabled.
(1)
The new table pg_yb_invalidation_messages is added during the finalization phase
of a upgrade process. Before that I can see the following logs:
```
W0403 16:09:36.040861 142435 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:09:36.832208 142470 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:09:36.932433 142444 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:09:37.071781 142453 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:09:37.862165 142476 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:09:37.961740 142484 master_heartbeat_service.cc:365] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
```
This happens for a 3-node dev machine local cluster, the same log is printed 3
times a second, once per heartbeat response. That's too much.
(2)
Run unit test
./yb_build.sh --cxx-test pg_catalog_version-test --gtest_filter PgCatalogVersionTest.WaitForSharedCatalogVersionToCatchup
Look at the test output for logs like the following:
```
[ts-1] 2025-04-03 16:11:58.032 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.132 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.232 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.332 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.433 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.533 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.633 UTC [144680] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:11:58.733 UTC [144680] LOG: waiting for shared catalog version to reach 199
```
The log is printed every 0.1 second, that's too much.
I made a fix to address these two. For the first log, I changed to use
YB_LOG_EVERY_N_SECS(WARNING, 60) so that the NotFound log is printed once every
minute. For the second log, I changed to always print the first log, but then
print once every 0.1 * 20 = 2 seconds. In addition, I print the end result as
well and with a warning if the target version is not reached.
Test Plan:
1. build using commit 80c4195 that did not have
the table pg_yb_invalidation_messages. Using the build result to
(1) create a 3 node cluster:
./bin/yb-ctl create --rf 3
(2) stop the cluster
./bin/yb-ctl stop
(3) use the build with this diff to restart the cluster
./bin/yb-ctl start
(4) go to leader master node and look at yb-master.INFO
```
W0403 16:24:52.071898 147882 master_heartbeat_service.cc:370] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:25:52.798542 147908 master_heartbeat_service.cc:370] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:26:53.525211 147895 master_heartbeat_service.cc:370] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
W0403 16:27:54.263994 147837 master_heartbeat_service.cc:370] Could not get YSQL invalidation messages for heartbeat response: Not found (yb/tablet/tablet_metadata.cc:819): Table <unknown_table_name> (00000001000030008001000000001f90) not found in Raft group 00000000000000000000000000000000
```
We can see that the log is printed once every minute.
2. Run unit test
./yb_build.sh --cxx-test pg_catalog_version-test --gtest_filter PgCatalogVersionTest.WaitForSharedCatalogVersionToCatchup
Look at the output
```
[ts-1] 2025-04-03 16:30:43.392 UTC [150357] LOG: waiting for shared catalog version to reach 199
[ts-1] 2025-04-03 16:30:44.394 UTC [150357] LOG: shared catalog version has reached 199
```
We see the first log is printed, and the end result is also printed.
Reviewers: kfranz, sanketh, mihnea
Reviewed By: kfranz
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D42997
0 commit comments