diff --git a/go.mod b/go.mod index 7f332e9eba..1352343c0f 100644 --- a/go.mod +++ b/go.mod @@ -102,7 +102,7 @@ require ( github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect github.com/rancher/dynamiclistener v0.2.0 github.com/rancher/helm-controller v0.5.0 - github.com/rancher/kine v0.3.5 + github.com/rancher/kine v0.3.6-0.20200422224205-0a0f5b924129 github.com/rancher/remotedialer v0.2.0 github.com/rancher/wrangler v0.6.1 github.com/rancher/wrangler-api v0.6.0 diff --git a/go.sum b/go.sum index 97761283c5..274f6d8d1d 100644 --- a/go.sum +++ b/go.sum @@ -648,6 +648,8 @@ github.com/rancher/helm-controller v0.5.0 h1:BY5PG3dz6GWct2O9r8mFv73tZ7E5U9uI89Q github.com/rancher/helm-controller v0.5.0/go.mod h1:kEtAI/0AylXIplxWkIRR2xl3nhd4jZ6Wke1nvE/sKUs= github.com/rancher/kine v0.3.5 h1:Tm4eOtejpnzs1WFBrXj76lCLvX9czLlTkgqUk9luCQk= github.com/rancher/kine v0.3.5/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ= +github.com/rancher/kine v0.3.6-0.20200422224205-0a0f5b924129 h1:4HYvCG8+pfkBlpYLv/5ZOdxagg3jTszMOqMjamMQ0hA= +github.com/rancher/kine v0.3.6-0.20200422224205-0a0f5b924129/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ= github.com/rancher/kubernetes v1.18.2-k3s.1 h1:LhWNObWF7dL/+T57LkYpuRKtsCBpt0P5G6dRVFG+Ncs= github.com/rancher/kubernetes v1.18.2-k3s.1/go.mod h1:z8xjOOO1Ljz+TaHpOxVGC7cxtF32TesIamoQ+BZrVS0= github.com/rancher/kubernetes/staging/src/k8s.io/api v1.18.2-k3s.1 h1:tYDY9g8+xLwUcsG9T6Xg7cBkO/vgU6yv7cQKqUN6NDE= diff --git a/vendor/github.com/rancher/kine/pkg/drivers/mysql/mysql.go b/vendor/github.com/rancher/kine/pkg/drivers/mysql/mysql.go index 2ac53e048a..556ed33598 100644 --- a/vendor/github.com/rancher/kine/pkg/drivers/mysql/mysql.go +++ b/vendor/github.com/rancher/kine/pkg/drivers/mysql/mysql.go @@ -35,6 +35,7 @@ var ( );`, } nameIdx = "create index kine_name_index on kine (name)" + nameIDIdx = "create index kine_name_id_index on kine (name,id)" revisionIdx = "create unique index kine_name_prev_revision_uindex on kine (name, prev_revision)" createDB = "create database if not exists " ) @@ -87,6 +88,7 @@ func setup(db *sql.DB) error { // check if duplicate indexes indexes := []string{ nameIdx, + nameIDIdx, revisionIdx} for _, idx := range indexes { diff --git a/vendor/github.com/rancher/kine/pkg/drivers/pgsql/pgsql.go b/vendor/github.com/rancher/kine/pkg/drivers/pgsql/pgsql.go index 862287a5fa..2439d20409 100644 --- a/vendor/github.com/rancher/kine/pkg/drivers/pgsql/pgsql.go +++ b/vendor/github.com/rancher/kine/pkg/drivers/pgsql/pgsql.go @@ -35,6 +35,7 @@ var ( old_value bytea );`, `CREATE INDEX IF NOT EXISTS kine_name_index ON kine (name)`, + `CREATE INDEX IF NOT EXISTS kine_name_id_index ON kine (name,id)`, `CREATE UNIQUE INDEX IF NOT EXISTS kine_name_prev_revision_uindex ON kine (name, prev_revision)`, } createDB = "create database " diff --git a/vendor/github.com/rancher/kine/pkg/logstructured/logstructured.go b/vendor/github.com/rancher/kine/pkg/logstructured/logstructured.go index 4687003ccd..9fa4db3783 100644 --- a/vendor/github.com/rancher/kine/pkg/logstructured/logstructured.go +++ b/vendor/github.com/rancher/kine/pkg/logstructured/logstructured.go @@ -295,6 +295,7 @@ func (l *LogStructured) ttlEvents(ctx context.Context) chan *server.Event { func (l *LogStructured) ttl(ctx context.Context) { // vary naive TTL support + mutex := &sync.Mutex{} for event := range l.ttlEvents(ctx) { go func(event *server.Event) { select { @@ -302,7 +303,9 @@ func (l *LogStructured) ttl(ctx context.Context) { return case <-time.After(time.Duration(event.KV.Lease) * time.Second): } + mutex.Lock() l.Delete(ctx, event.KV.Key, event.KV.ModRevision) + mutex.Unlock() }(event) } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 8ee935bcbf..c3567eadea 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -730,7 +730,7 @@ github.com/rancher/helm-controller/pkg/generated/informers/externalversions/helm github.com/rancher/helm-controller/pkg/generated/informers/externalversions/internalinterfaces github.com/rancher/helm-controller/pkg/generated/listers/helm.cattle.io/v1 github.com/rancher/helm-controller/pkg/helm -# github.com/rancher/kine v0.3.5 +# github.com/rancher/kine v0.3.6-0.20200422224205-0a0f5b924129 github.com/rancher/kine/pkg/broadcaster github.com/rancher/kine/pkg/client github.com/rancher/kine/pkg/drivers/dqlite