Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support compact for etcd v3 #68

Open
Yiyiyimu opened this issue Jul 14, 2020 · 1 comment
Open

feature: support compact for etcd v3 #68

Yiyiyimu opened this issue Jul 14, 2020 · 1 comment

Comments

@Yiyiyimu
Copy link
Contributor

The length of keyspace is not limited to 1000 anymore in v3. To avoid performance degradation and eventual storage space exhaustion, operation compact could drop all information about keys superseded prior to a given keyspace revision. And the compacted ones could not be accessed by get or watch. Normally, there would be auto compaction when etcd is running.
Detail could be found here.

@Yiyiyimu
Copy link
Contributor Author

Currently when I test to get the key at the compacted revision, the response would be successfully returned as

# +{
# +  body = {
# +    code = 11,
# +    error = "etcdserver: mvcc: required revision has been compacted",
# +    message = "etcdserver: mvcc: required revision has been compacted"
# +  },
# +  body_reader = <function 1>,
# +  has_body = true,
# +  headers = {
# +    ["Access-Control-Allow-Headers"] = "accept, content-type, authorization",
# +    ["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE",
# +    ["Access-Control-Allow-Origin"] = "*",
# +    ["Content-Type"] = "application/json",
# +    Date = "Tue, 14 Jul 2020 02:34:11 GMT",
# +    Trailer = "Grpc-Trailer-Content-Type",
# +    ["Transfer-Encoding"] = "chunked",
# +    <metatable> = {
# +      __index = <function 2>,
# +      __newindex = <function 3>,
# +      normalised = {
# +        ["access-control-allow-headers"] = "Access-Control-Allow-Headers",
# +        ["access-control-allow-methods"] = "Access-Control-Allow-Methods",
# +        ["access-control-allow-origin"] = "Access-Control-Allow-Origin",
# +        ["content-type"] = "Content-Type",
# +        date = "Date",
# +        trailer = "Trailer",
# +        ["transfer-encoding"] = "Transfer-Encoding"
# +      }
# +    }
# +  },
# +  read_body = <function 4>,
# +  read_trailers = <function 5>,
# +  reason = "Bad Request",
# +  status = 400,
# +  trailer_reader = <function 6>

However, there would be error:

"2020/07/14 10:27:29 [error] 22853#0: *1 [lua] http.lua:951: request_uri(): unread data in buffer, client: 127.0.0.1, server: localhost, request: \"GET /t HTTP/1.1\", host: \"localhost\""

I'll submit a draft PR to reproduce the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant