kine update

pull/1672/head
galal-hussein 2020-04-23 00:46:46 +02:00
parent 94da8b8e12
commit 30b1fb0e98
6 changed files with 10 additions and 2 deletions

2
go.mod
View File

@ -102,7 +102,7 @@ require (
github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect
github.com/rancher/dynamiclistener v0.2.0 github.com/rancher/dynamiclistener v0.2.0
github.com/rancher/helm-controller v0.5.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/remotedialer v0.2.0
github.com/rancher/wrangler v0.6.1 github.com/rancher/wrangler v0.6.1
github.com/rancher/wrangler-api v0.6.0 github.com/rancher/wrangler-api v0.6.0

2
go.sum
View File

@ -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/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 h1:Tm4eOtejpnzs1WFBrXj76lCLvX9czLlTkgqUk9luCQk=
github.com/rancher/kine v0.3.5/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ= 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 h1:LhWNObWF7dL/+T57LkYpuRKtsCBpt0P5G6dRVFG+Ncs=
github.com/rancher/kubernetes v1.18.2-k3s.1/go.mod h1:z8xjOOO1Ljz+TaHpOxVGC7cxtF32TesIamoQ+BZrVS0= 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= github.com/rancher/kubernetes/staging/src/k8s.io/api v1.18.2-k3s.1 h1:tYDY9g8+xLwUcsG9T6Xg7cBkO/vgU6yv7cQKqUN6NDE=

View File

@ -35,6 +35,7 @@ var (
);`, );`,
} }
nameIdx = "create index kine_name_index on kine (name)" 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)" revisionIdx = "create unique index kine_name_prev_revision_uindex on kine (name, prev_revision)"
createDB = "create database if not exists " createDB = "create database if not exists "
) )
@ -87,6 +88,7 @@ func setup(db *sql.DB) error {
// check if duplicate indexes // check if duplicate indexes
indexes := []string{ indexes := []string{
nameIdx, nameIdx,
nameIDIdx,
revisionIdx} revisionIdx}
for _, idx := range indexes { for _, idx := range indexes {

View File

@ -35,6 +35,7 @@ var (
old_value bytea old_value bytea
);`, );`,
`CREATE INDEX IF NOT EXISTS kine_name_index ON kine (name)`, `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)`, `CREATE UNIQUE INDEX IF NOT EXISTS kine_name_prev_revision_uindex ON kine (name, prev_revision)`,
} }
createDB = "create database " createDB = "create database "

View File

@ -295,6 +295,7 @@ func (l *LogStructured) ttlEvents(ctx context.Context) chan *server.Event {
func (l *LogStructured) ttl(ctx context.Context) { func (l *LogStructured) ttl(ctx context.Context) {
// vary naive TTL support // vary naive TTL support
mutex := &sync.Mutex{}
for event := range l.ttlEvents(ctx) { for event := range l.ttlEvents(ctx) {
go func(event *server.Event) { go func(event *server.Event) {
select { select {
@ -302,7 +303,9 @@ func (l *LogStructured) ttl(ctx context.Context) {
return return
case <-time.After(time.Duration(event.KV.Lease) * time.Second): case <-time.After(time.Duration(event.KV.Lease) * time.Second):
} }
mutex.Lock()
l.Delete(ctx, event.KV.Key, event.KV.ModRevision) l.Delete(ctx, event.KV.Key, event.KV.ModRevision)
mutex.Unlock()
}(event) }(event)
} }
} }

2
vendor/modules.txt vendored
View File

@ -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/informers/externalversions/internalinterfaces
github.com/rancher/helm-controller/pkg/generated/listers/helm.cattle.io/v1 github.com/rancher/helm-controller/pkg/generated/listers/helm.cattle.io/v1
github.com/rancher/helm-controller/pkg/helm 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/broadcaster
github.com/rancher/kine/pkg/client github.com/rancher/kine/pkg/client
github.com/rancher/kine/pkg/drivers/dqlite github.com/rancher/kine/pkg/drivers/dqlite