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

Already on GitHub? Sign in to your account

Config nondeterministic lua #483

Closed
wants to merge 203 commits into
from

Conversation

Projects
None yet

I had a use case for enabling this because I need to adjust the value to a key depending on the amount of server time that had elapsed since it was last written to.

For lack of a better name I implemented "time decaying lazy counters" using a LUA script and INCR.

The option is named "lua-nondeterministic-calls" and is disabled by default for obvious reasons.

I modified default.conf in tests/assets/ and all the tests pass when it is "no" or not set.

The 2 tests you would expect to fail do fail when it is enabled.

-- Jeff

antirez and others added some commits Mar 10, 2012

RDB version is no 4, because small hashes are now encoded as ziplists…
…, so older versions of Redis will not understand this format.
RDB hashes loading, fixed another bug in the loading of HT-encoded ha…
…shes: when the hash entry is too big for ziplist, add the field, then convert. The code used to break before the new entry was inserted, resulting into missing fields in the loaded Hash object.
sds.c new function sdsRemoveFreeSpace().
The new function is used in order to resize the string allocation so
that only the minimal allocation possible is used, removing all the free
space at the end of the string normally used to improve efficiency of
concatenation operations.
Fix for issue #391.
Use a simple protocol between clientsCron() and helper functions to
understand if the client is still valind and clientsCron() should
continue processing or if the client was freed and we should continue
with the next one.
Number of iteration of --test-memory is now 300 (several minutes per …
…gigabyte). Memtest86 and Memtester links are also displayed while running the test.
Support for read-only slaves. Semantical fixes.
This commit introduces support for read only slaves via redis.conf and CONFIG GET/SET commands. Also various semantical fixes are implemented here:

1) MULTI/EXEC with only read commands now work where the server is into a state where writes (or commands increasing memory usage) are not allowed. Before this patch everything inside a transaction would fail in this conditions.

2) Scripts just calling read-only commands will work against read only
slaves, when the server is out of memory, or when persistence is into an
error condition. Before the patch EVAL always failed in this condition.
DEBUG should not be flagged as w otherwise we can not call DEBUG DIGE…
…ST and other commands against read only slaves.
Result of INCRBYFLOAT and HINCRBYFLOAT should never be in exponential…
… form, and also should never contain trailing zeroes. This is not possible with vanilla printf() format specifiers, so we alter the output.
When running the test in valgrind mode, pass the right flags to show …
…memory leaks stack traces but only including the "definitely lost" items.
convert-zipmap-hash-on-load false positive fixed.
Apparently because the sample RDB file was not copied before every test
Redis had a chance to replace it with a newly written one, so that the
next test could fail.
New INFO field aof_delayed_fsync introduced.
This new field counts all the times Redis is configured with AOF enabled and
fsync policy 'everysec', but the previous fsync performed by the
background thread was not able to complete within two seconds, forcing
Redis to perform a write against the AOF file while the fsync is still
in progress (likely a blocking operation).
SIGSEGV handler refactored so that we can reuse stack trace and curre…
…nt client logging functionalities in other contexts.

antirez and others added some commits Apr 13, 2012

Rename ADD_*FLAGS -> REDIS_*FLAGS, REDIS_*FLAGS -> FINAL_*FLAGS
This reflects that REDIS_*FLAGS will only be used for compilation of
Redis and not for its dependencies. Similarly, that FINAL_*FLAGS are
composed of other variables and holds the options that are finally
passed to the compiler and linker.
The lcov target shouldn't clean
This is not needed because every change in compiler/linker flags
triggers a cleanup.
lookupKeyByPattern() used by SORT GET/BY rewritten. Fixes issue #460.
lookupKeyByPattern() was implemented with a trick to speedup the lookup
process allocating two fake Redis obejcts on the stack. However now that
we propagate expires to the slave as DEL operations the lookup of the
key may result into a call to expireIfNeeded() having the stack
allocated object as argument, that may in turn use it to create the
protocol to send to the slave. But since this fake obejcts are
inherently read-only this is a problem.

As a side effect of this fix there are no longer size limits in the
pattern to be used with GET/BY option of SORT.

See #460 for bug details.
Two small fixes to maxclients handling.
1) Don't accept maxclients set to < 0
2) Allow maxclients < 1024, it is useful for testing.
Marginally cleaner lookupKeyByPattern() implementation.
just fieldobj itself as sentinel of the fact a field object is used or
not, instead of using the filed length, that may be confusing both for
people and for the compiler emitting a warning.
Merge pull request #455 from pietern/2.6-mkopts
Persist Makefile flags (2.6)
Limit memory used by big SLOWLOG entries.
Two limits are added:

1) Up to SLOWLOG_ENTRY_MAX_ARGV arguments are logged.
2) Up to SLOWLOG_ENTRY_MAX_STRING bytes per argument are logged.
3) slowlog-max-len is set to 128 by default (was 1024).

The number of remaining arguments / bytes is logged in the entry
so that the user can understand better the nature of the logged command.
Replace unnecessary calls to echo and cat
Tcl's exec can send data to stdout itself, no need to call cat/echo for
that usually.
Fix and refactoring of code used to get registers on crash.
This fixes compilation on FreeBSD (and possibly other systems) by
not using ucontext_t at all if HAVE_BACKTRACE is not defined.
Also the ifdefs to get the registers are modified to explicitly test for the
operating system in the first level, and the arch in the second level
of nesting.
Add a 24bit integer to ziplists to save one byte for ints that can
fit in 24 bits (thanks to antirez for catching and solving the two's compliment
bug).

Increment REDIS_RDB_VERSION to 6
Added two new encodings to ziplist.c
1) One integer "immediate" encoding that can encode from 0 to 12 in the
encoding byte itself.
2) One 8 bit signed integer encoding that can encode 8 bit signed small
integers in a single byte.

The idea is to exploit all the not used bits we have around in a
backward compatible way.
added another version that sets expirations on the last modified key …
…and the counter key so the server cleans up after itself

@badboy badboy closed this Jul 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment