From 06c75fdce6099b61aba4a03fa83c33d528f9d5e3 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 10 May 2023 15:30:29 +0200 Subject: [PATCH] Remove redis specific workout from cache code This bumps the go-micro/v4/store/redis fork to include these fixes: https://github.com/go-micro/plugins/pull/109 https://github.com/go-micro/plugins/pull/110 And removes the workaround of stripping the table prefixes in our code. --- changelog/unreleased/fix-remove-redis-workaround.md | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- pkg/storage/cache/cache.go | 3 --- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changelog/unreleased/fix-remove-redis-workaround.md diff --git a/changelog/unreleased/fix-remove-redis-workaround.md b/changelog/unreleased/fix-remove-redis-workaround.md new file mode 100644 index 00000000000..6a1b419784d --- /dev/null +++ b/changelog/unreleased/fix-remove-redis-workaround.md @@ -0,0 +1,7 @@ +Bugfix: Remove go-micro/store/redis specific workaround + +We submitted an upstream fix for an issue in the go-micro/store redis plugin. +Which allowed us to remove a redis specific workaround from the reva storage +cache implementation. + +https://github.com/cs3org/reva/pull/xxxx diff --git a/go.mod b/go.mod index a7930a7faef..2f19da6dbd9 100644 --- a/go.mod +++ b/go.mod @@ -215,5 +215,5 @@ require ( replace ( github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 - github.com/go-micro/plugins/v4/store/redis => github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f + github.com/go-micro/plugins/v4/store/redis => github.com/rhafer/go-micro-plugins/v4/store/redis v1.0.1-0.20230510130353-f6541e2f520c ) diff --git a/go.sum b/go.sum index 4019578d23e..6bd76dc9b0c 100644 --- a/go.sum +++ b/go.sum @@ -261,8 +261,6 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f h1:5siFx2qvzmMSIWJvN2JhdJmU0tlqIFzgcfOnJm8sGTg= -github.com/dragonchaser/go-micro-plugins/v4/store/redis v0.0.0-20230508144354-06738dcca00f/go.mod h1:MbCG0YiyPqETTtm7uHFmxQNCaW1o9hBoYtFwhbVjLUg= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= @@ -825,6 +823,8 @@ github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0ua github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= github.com/prometheus/statsd_exporter v0.22.8 h1:Qo2D9ZzaQG+id9i5NYNGmbf1aa/KxKbB9aKfMS+Yib0= github.com/prometheus/statsd_exporter v0.22.8/go.mod h1:/DzwbTEaFTE0Ojz5PqcSk6+PFHOPWGxdXVr6yC8eFOM= +github.com/rhafer/go-micro-plugins/v4/store/redis v1.0.1-0.20230510130353-f6541e2f520c h1:c2e/k/UF31vITixuslq2y401ztbAsPDMTKIMfh26WIw= +github.com/rhafer/go-micro-plugins/v4/store/redis v1.0.1-0.20230510130353-f6541e2f520c/go.mod h1:MbCG0YiyPqETTtm7uHFmxQNCaW1o9hBoYtFwhbVjLUg= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= diff --git a/pkg/storage/cache/cache.go b/pkg/storage/cache/cache.go index cf6a7a12fe8..4f40bf016a4 100644 --- a/pkg/storage/cache/cache.go +++ b/pkg/storage/cache/cache.go @@ -211,9 +211,6 @@ func (cache cacheStore) List(opts ...microstore.ListOption) ([]string, error) { if err != nil { return nil, err } - for i, key := range keys { - keys[i] = strings.TrimPrefix(key, cache.table) - } return keys, nil }