kragniz / kragniz/python-etcd3

limit is not used in `get_range_request` of 0.12.0

Open
#1,716 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
450
Forks
194
PR merge metrics
No merged PRs in 30d

Description

I want to read the last revision of a key with prefix

```
response = etcd.get_prefix_response(settings.CONF_PREFIX, sort_order='descend', sort_target='mod', limit=1)
print(response.header.revision)
```

but report `grpc body is greater then 4M` when key/value is big in etcd
```
Received_message larger than max(4194304)
```

This problem occurs because `limit` is not used in the body of `_build_get_range_request`,
but fix in the master branch, When will the next stable release be?

Contributor guide

Open the contributing guide

Research direction

Start by comparing the 0.12.0 implementation of `_build_get_range_request` with the fix in the master branch. Reproduce the `get_prefix_response` call with `sort_order='descend'`, `sort_target='mod'`, and `limit=1` against a large value; done means the limit is applied and the response revision can be read without exceeding the 4 MiB gRPC message limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.