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
MySQL 8.0 has introduced cache to improve the efficiency of information_schema queries, so it may lead to a consequence that users could not get the latest and accurate statistics when querying information_schema.
If using MySQL 8.0 as storage layer, trillian codes, without setting the session variable information_schema_stats_expiry (the default is 86400 seconds), could not pass the TestMySQLRateLimiting and TestQuotaManager_GetTokens_InformationSchema.
--- FAIL: TestMySQLRateLimiting (1.13s)
quota_test.go:100: Test MySQL available at "root@tcp(127.0.0.1)/"
quota_test.go:124: timed out before rate limiting kicked in
FAIL
FAIL github.com/google/trillian/integration/quota 8.509s
--- FAIL: TestQuotaManager_GetTokens_InformationSchema (1.44s)
mysql_quota_test.go:118: Test MySQL available at "root@tcp(127.0.0.1)/"
--- FAIL: TestQuotaManager_GetTokens_InformationSchema/useSelectCount_=_false (1.34s)
mysql_quota_test.go:170: timed out
FAIL
FAIL github.com/google/trillian/quota/mysqlqm 4.407s
The countFromInformationSchema function in the codes depends on information_schema to return the latest statistics,
countFromInformationSchemaQuery=` SELECT table_rows FROM information_schema.tables WHERE table_schema = schema() AND table_name = ? AND table_type = ?`
funccountFromInformationSchema(ctx context.Context, db*sql.DB) (int, error) {
// information_schema.tables doesn't have an explicit PK, so let's play it safe and ensure// the cursor returns a single row.rows, err:=db.QueryContext(ctx, countFromInformationSchemaQuery, "Unsequenced", "BASE TABLE")
iferr!=nil {
return0, err
}
deferrows.Close()
if!rows.Next() {
return0, errors.New("cursor has no rows after information_schema query")
}
varcountintiferr:=rows.Scan(&count); err!=nil {
return0, err
}
ifrows.Next() {
return0, errors.New("too many rows returned from information_schema query")
}
returncount, nil
}
so anything that relies on this function may fail to work as normal.
The text was updated successfully, but these errors were encountered:
MySQL 8.0 has introduced cache to improve the efficiency of information_schema queries, so it may lead to a consequence that users could not get the latest and accurate statistics when querying information_schema.
If using MySQL 8.0 as storage layer, trillian codes, without setting the session variable
information_schema_stats_expiry
(the default is 86400 seconds), could not pass theTestMySQLRateLimiting
andTestQuotaManager_GetTokens_InformationSchema
.The countFromInformationSchema function in the codes depends on information_schema to return the latest statistics,
so anything that relies on this function may fail to work as normal.
The text was updated successfully, but these errors were encountered: