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
ProxySQL_Statistics::statsdb_disk (lib/ProxySQL_Statistics.cpp, ctor) and ProxySQL_Admin::statsdb_disk (lib/Admin_Bootstrap.cpp) are two independent SQLite3DB instances opened against the same on-disk proxysql_stats.db. The commented-out line // statsdb_disk = GloAdmin->statsdb_disk; in the statistics ctor shows this was once intended to be shared.
Consequences:
SQLite3DB's per-instance rwlock cannot serialize writers across the two connections; only SQLite's own file locking + busy-retry does. PR Cluster leader election + leader-side TSDB stats aggregation (cluster as a single entity, phase 1) #6034 added wrlock() around every explicit transaction on the statistics connection, but the eventslog dumps (MySQL_Logger::insertMysqlEventsIntoDb, PgSQL twin) run on the Admin connection and therefore serialize only at the file level.
Two connections means two page caches and two journals for one file.
Decide and document: either unify onto one connection (and one lock), or state explicitly that cross-connection serialization is by SQLite file locking and remove the misleading commented-out line.
ProxySQL_Statistics::statsdb_disk(lib/ProxySQL_Statistics.cpp, ctor) andProxySQL_Admin::statsdb_disk(lib/Admin_Bootstrap.cpp) are two independentSQLite3DBinstances opened against the same on-diskproxysql_stats.db. The commented-out line// statsdb_disk = GloAdmin->statsdb_disk;in the statistics ctor shows this was once intended to be shared.Consequences:
SQLite3DB's per-instancerwlockcannot serialize writers across the two connections; only SQLite's own file locking + busy-retry does. PR Cluster leader election + leader-side TSDB stats aggregation (cluster as a single entity, phase 1) #6034 addedwrlock()around every explicit transaction on the statistics connection, but the eventslog dumps (MySQL_Logger::insertMysqlEventsIntoDb, PgSQL twin) run on the Admin connection and therefore serialize only at the file level.Decide and document: either unify onto one connection (and one lock), or state explicitly that cross-connection serialization is by SQLite file locking and remove the misleading commented-out line.