mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 23:37:01 -06:00
Alerting: Increase size of kvstore value type for MySQL to LONGTEXT (#80331)
* Alerting: Increase size of kvstore value type for MySQL to LONGTEXT alertmanager uses the kvstore to persist its notification log and the current column limit for MySQL (16.7mb) puts the maximum entries at a level that is potentially achievable for heavy alerting users (~40-80k entries). In comparison, the current type for PSQL (TEXT) is effectively unlimited and I believe SQLIte defaults to 2gb which is also plenty of leeway.
This commit is contained in:
parent
ca9d147a44
commit
5ecc7dd2fa
@ -25,3 +25,10 @@ func addKVStoreMigrations(mg *Migrator) {
|
||||
|
||||
mg.AddMigration("add index kv_store.org_id-namespace-key", NewAddIndexMigration(kvStoreV1, kvStoreV1.Indices[0]))
|
||||
}
|
||||
|
||||
// addKVStoreMySQLValueTypeLongTextMigration adds a migration to change the column type of kv_store.value to LONGTEXT for
|
||||
// MySQL to be more inline size-wise with PSQL (TEXT) and SQLite.
|
||||
func addKVStoreMySQLValueTypeLongTextMigration(mg *Migrator) {
|
||||
mg.AddMigration("alter kv_store.value to longtext", NewRawSQLMigration("").
|
||||
Mysql("ALTER TABLE kv_store MODIFY value LONGTEXT NOT NULL;"))
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ func (*OSSMigrations) AddMigration(mg *Migrator) {
|
||||
ssosettings.AddMigration(mg)
|
||||
|
||||
ualert.CreateOrgMigratedKVStoreEntries(mg)
|
||||
|
||||
addKVStoreMySQLValueTypeLongTextMigration(mg)
|
||||
}
|
||||
|
||||
func addStarMigrations(mg *Migrator) {
|
||||
|
Loading…
Reference in New Issue
Block a user