Commit Graph

6393 Commits

Author SHA1 Message Date
e0cc3c99d2 Additional config.c refactory and bugfixes
- add capability for each config to have a callback to check if value is valid and return error string
  will enable converting many of the remaining custom configs into generic ones (reducing the x4 repetition for set,get,config,rewrite)
- add capability for each config to  to run some update code after config is changed (only for CONFIG SET)
  will also enable converting many of the remaining custom configs into generic ones
- add capability to move default values from server.h and server.c to config.c
  will reduce many excess lines in server.h and server.c (plus, no need to rebuild the entire code base when a default change 8-))

other behavior changes:
- fix bug in bool config get (always returning 'yes')
- fix a bug in modifying jemalloc-bg-thread at runtime (didn't call set_jemalloc_bg_thread, due to bad merge conflict resolution (my fault))
- side effect when a failed attempt to enable activedefrag at runtime, we now respond with -ERR and not with -DISABLED
2019-11-26 16:52:28 +02:00
a40669893e Merge pull request #6609 from daidaotong/macrofix
Add macro in bio.h
2019-11-25 10:04:28 +01:00
6203ed0474 Merge pull request #6593 from daidaotong/movecommandfix
fix move command: WATCH/MULTI/EXEC mechanism breaks
2019-11-25 10:02:43 +01:00
d39afb687d Merge pull request #6563 from devnexen/fbsd_build_fix2
Add missing header
2019-11-25 09:45:29 +01:00
ef5186d920 config.c: remove trailing spaces, trim comments to 80 cols. 2019-11-22 17:54:22 +01:00
a5e4c95cfd Merge pull request #6607 from madolson/dev-unstable-new-refactor
Refactored configs into types that can be generic
2019-11-22 17:42:42 +01:00
6b056d29f3 block: propagate BRPOPLPUSH as RPOPLPUSH when unblock 2019-11-22 16:38:49 +08:00
2c970532dc Propagation: flag module client as CLIENT_MULTI if needed
in case of nested MULTI/EXEC
2019-11-22 16:20:30 +08:00
c73d70fb46 Propagation: propagate EXEC directly in lua script 2019-11-22 15:45:21 +08:00
37a10cef02 Propagation: wrap commands in also_propagate array with MULIT/EXEC
Random command like SPOP with count is replicated as
some SREM operations, and store them in also_propagate
array to propagate after the call, but this would break
atomicity.

To keep the command's atomicity, wrap also_propagate
array with MULTI/EXEC.
2019-11-22 15:42:49 +08:00
e8f4010e27 Changed a tab to a space 2019-11-22 06:44:12 +00:00
d50ae36e17 Fixed a bug with enum log printing 2019-11-22 06:28:50 +00:00
818a4e0f70 Fixed some linux warnings 2019-11-22 05:49:52 +00:00
519822bcf9 Added a flag for strings that are stored as NULL 2019-11-21 21:31:53 -08:00
73841e8c49 scripting: a little refactor about EVAL and redis.call()
Change server.lua_client's flag in a more explicit way.
2019-11-22 11:58:03 +08:00
097c4a6536 scripting: flag lua_client as CLIENT_MULTI after redis.replicate_commands() immediately
To avoid nested MULTI/EXEC, we check the lua_caller's flag,
if we are in the MULTI context we flag the lua_client as
CLIENT_MULTI, but it's not enough we shoud flag lua_client
as CLIENT_MULTI after redis.replicate_commands() immediately
or the first write command after redis.replicate_commands()
cannot know it's in an transaction, I know the missing CLIENT_MULTI
doesn't have any effect now, but it's a real bug and we should fix
it, in case someday we allow some dangerous command like BLPOP.
2019-11-22 11:51:18 +08:00
64c2508ee3 Merge branch 'unstable' into rm_get_server_info 2019-11-21 10:06:15 +01:00
f1f259de5b Merge pull request #6547 from guybe7/module_api_streams
Support streams in general module API functions
2019-11-21 10:03:50 +01:00
da47d52c79 Recomment PR #6346. 2019-11-21 10:01:49 +01:00
70469b76d6 Merge branch 'unstable' into expose_zmalloc_capabilities 2019-11-21 09:57:19 +01:00
bfd8c1fdd2 macro fix
macro fix
2019-11-20 20:39:04 -05:00
c7b68d10ea Prune leftover TODO comment
Is it sufficient... ? -- Yes it is. In standalone mode, we say READY=1
at the comment point; however in replicated mode, we delay sending
READY=1 until the replication sync completes.
2019-11-20 19:45:25 +02:00
803d765d49 Refactored renaming types in config 2019-11-20 09:22:38 -08:00
c697edf4f4 Merge pull request #6559 from oranagra/active_defrag_tunables
Adjustments for active defrag defaults
2019-11-20 10:08:08 +01:00
129d14e143 Auto-detect and link libsystemd at compile-time
This adds Makefile/build-system support for USE_SYSTEMD=(yes|no|*). This
variable's value determines whether or not libsystemd will be linked at
build-time.

If USE_SYSTEMD is set to "yes", make will use PKG_CONFIG to check for
libsystemd's presence, and fail the build early if it isn't
installed/detected properly.

If USE_SYSTEM is set to "no", libsystemd will *not* be linked, even if
support for it is available on the system redis is being built on.

For any other value that USE_SYSTEM might assume (e.g. "auto"),
PKG_CONFIG will try to determine libsystemd's presence, and set up the
build process to link against it, if it was indicated as being
installed/available.

This approach has a number of repercussions of its own, most importantly
the following: If you build redis on a system that actually has systemd
support, but no libsystemd-dev package(s) installed, you'll end up
*without* support for systemd notification/status reporting support in
redis-server. This changes established runtime behaviour.

I'm not sure if the build system and/or the server binary should
indicate this. I'm also wondering if not actually having
systemd-notify-support, but requesting it via the server's config,
should result in a fatal error now.
2019-11-19 18:55:44 +02:00
641c64ada1 Use libsystemd's sd_notify for communicating redis status to systemd
Instead of replicating a subset of libsystemd's sd_notify(3) internally,
use the dynamic library provided by systemd to communicate with the
service manager.

When systemd supervision was auto-detected or configured, communicate
the actual server status (i.e. "Loading dataset", "Waiting for
master<->replica sync") to systemd, instead of declaring readiness right
after initializing the server process.
2019-11-19 18:55:44 +02:00
e7144fbed8 Merge branch 'unstable' into module-long-double 2019-11-19 12:15:45 +01:00
e916058f0b Merge pull request #6557 from oranagra/rm_lru_lfu_revized
rename RN_SetLRUOrLFU -> RM_SetLRU and RN_SetLFU
2019-11-19 11:58:07 +01:00
fe5aea38c3 Simplify PR #6551 implementation. 2019-11-19 11:56:02 +01:00
065872e001 Merge pull request #6551 from pvalsecc/sentinel_kill_pubsub
Redis sentinel kill pubsub client connections as well
2019-11-19 11:53:10 +01:00
2151b82be9 Merge pull request #6571 from wangzhione/patch-2
Update adlist.h
2019-11-19 11:42:46 +01:00
06a24b9cfa Merge pull request #6597 from yossigo/rm-call-extended-errors
Improve RM_Call() errno classification.
2019-11-19 11:41:32 +01:00
8e95064408 Merge pull request #6134 from zhouyuan/fix_aof
aof: fix assignment for aof_fsync_offset
2019-11-19 11:40:34 +01:00
ce03d68332 Rename var to fixed_time_expire now that is more general. 2019-11-19 11:28:04 +01:00
b42466b925 Fix patch provided in #6554. 2019-11-19 11:23:43 +01:00
6a9851c7f8 Merge pull request #6554 from soloestoy/unblock-as-call
expires & blocking: handle ready keys as call()
2019-11-19 11:14:05 +01:00
2d1e893b3e Improve RM_Call() errno classification.
RM_Call() will now use EBADF and ENONET in addition to EINVAL in order
to provide more information about errors (i.e. when return value is
NULL).
2019-11-19 12:10:48 +02:00
77ad9aaafe Merge branch 'unstable' of github.com:/antirez/redis into unstable 2019-11-19 11:10:35 +01:00
656e40eed2 Merge branch 'unstable' into scan_module_impl 2019-11-19 11:08:02 +01:00
5b80a41cad Remove additional space from comment. 2019-11-19 11:05:55 +01:00
1530a3cfc6 Merge pull request #6577 from oranagra/module_doc
module docs, missing LOADING flag
2019-11-19 11:02:58 +01:00
32a8301073 Merge pull request #4076 from yossigo/add_mt_replacevalue
Add RM_ModuleTypeReplaceValue.
2019-11-19 11:00:01 +01:00
3d89210477 Merge pull request #3383 from yossigo/datatype_load_save
Redis Module API calls to allow re-use of data type RDB save/load.
2019-11-19 10:55:42 +01:00
a7122f4518 Merge pull request #6579 from oranagra/rm_reply_string_opt
Slightly more efficient RM_ReplyWithEmptyString
2019-11-19 10:54:00 +01:00
70016f7861 Merge pull request #6574 from guybe7/fix_xadd_empty_id
XADD with ID 0-0 stores an empty key
2019-11-19 10:50:45 +01:00
7c95e89ec3 Update mkreleasehdr.sh
fix date +%s errata
2019-11-19 17:23:47 +08:00
4ece8bd7a7 fix move command 2019-11-19 00:02:45 -05:00
e8ceba4e64 Expire cycle: set a buckets limit as well. 2019-11-18 17:47:19 +01:00
2ab51a644d Expire cycle: fix parameters computation. 2019-11-18 11:43:42 +01:00
1ccc270a2c Expire cycle: make expire effort configurable. 2019-11-18 11:33:44 +01:00