Pottery Versions Save

Redis for humans. 🌎🌍🌏

v1.4.2

2 years ago

Bug Fix: In NextId.reset(), reset all Redis masters

Previously, I'd modified the NextId.__current_id getter to get the ID from n // 2 + 1 Redis masters, then to return the highest of those IDs.

This means that NextId.reset() must delete the Redis key from all masters.

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.4.1...v1.4.2

v1.4.1

2 years ago

Optimization: Make consensus-based read ops more efficient

On read operations, once we've achieved quorum and read the value that we need, cancel pending in-flight futures.

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.4.0...v1.4.1

v1.4.0

2 years ago

New Feature: NextId.reset()

NextId.reset() deletes the NextId object's key from the Redis masters, in effect resetting the current ID to 0.

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.6...v1.4.0

v1.3.6

2 years ago

Bug Fix: Make Pottery work for both bytes and str responses

  1. Bug Fix: By default, the Redis client returns bytes responses. However, the Redis client can be configured to return str responses. Make Pottery work for either type of responses.
  2. Optimization: simplify NextId initialization.

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.5...v1.3.6

v1.3.5

2 years ago

Bug Fix: Ensure that we return pipeline connection to pool

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.4...v1.3.5

v1.3.4

2 years ago

New Feature: Monkey patch the Redis client to implement LOLWUT

  1. LOLWUT command: https://redis.io/commands/lolwut
  2. PR upstream: https://github.com/andymccurdy/redis-py/pull/1448

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.3...v1.3.4

v1.3.3

2 years ago

Bug Fix: Remove I/O from Redlock.__repr__() and NextId.__repr__()

When the Redis connection pool is exhausted, the Redis client throws ConnectionErrors. Then the Sentry SDK tries to record the tracebacks. If you have a Redlock or a NextId anywhere in those tracebacks, then the Sentry SDK calls repr() on those objects. And if those objects' .__repr__()s try to talk to Redis, then the client throws nested ConnectionErrors.

So don't talk to Redis from Redlock.__repr__() or NextId.__repr__().

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.2...v1.3.3

v1.3.2

2 years ago
  1. Quality of Life: Raise ValueError on invalid arguments to Redlock.__init__()
  2. Optimization: Define _ContextPipeline.__slots__ to reduce memory usage and improve performance
  3. Quality of Life: Track and log the time that the @synchronize() decorator spends waiting for and holding the Redlock

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.1...v1.3.2

v1.3.1

2 years ago

Optimization: Define .__slots__ on Redlock and NextId

Redlock and NextId are designed to be instantiated often. .__slots__ might help someone.

  1. https://docs.python.org/3/reference/datamodel.html#slots
  2. https://stackoverflow.com/a/28059785

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.3.0...v1.3.1

v1.3.0

2 years ago

New Feature: Allow blocking/timeout behavior when using Redlock as a context manager

Discussion here: https://github.com/brainix/pottery/issues/422

What's Changed

Full Changelog: https://github.com/brainix/pottery/compare/v1.2.1...v1.3.0