summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Geo: addReplyDoubleDistance() precision set to 4 digitsantirez2015-06-221-6/+8
| | | | | | Also: 1. The function was renamed. 2. An useless initialization of a buffer was removed.
* Geo: JSON features removedantirez2015-06-226-460/+25
| | | | | The command can only return data in the normal Redis protocol. It is up to the caller to translate to JSON if needed.
* Geo: removed bool usage from Geo code inside Redisantirez2015-06-223-34/+34
|
* Geo: removed JSON failing test (false positive)antirez2015-06-221-8/+0
| | | | | Server output is matched to a pre-computed output. The last digits differ because of rouding errors.
* Geo: removed useless functions, Marcatore coordinates, bool usageantirez2015-06-224-213/+92
|
* [In-Progress] Add Geo CommandsMatt Stancliff2015-06-2217-6/+2167
| | | | | | | | | | | | | | | | | | | | | | | | Current todo: - replace functions in zset.{c,h} with a new unified Redis zset access API. Once we get the zset interface fixed, we can squash relevant commits in this branch and have one nice commit to merge into unstable. This commit adds: - Geo commands - Tests; runnable with: ./runtest --single unit/geo - Geo helpers in deps/geohash-int/ - src/geo.{c,h} and src/geojson.{c,h} implementing geo commands - Updated build configurations to get everything working - TEMPORARY: src/zset.{c,h} implementing zset score and zset range reading without writing to client output buffers. - Modified linkage of one t_zset.c function for use in zset.c Conflicts: src/Makefile src/redis.c
* Sentinel: fix bug in config rewriting during failoverantirez2015-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a check to rewrite the config properly when a failover is in progress, in order to add the current (already failed over) master as slave, and don't include in the slave list the promoted slave itself. However there was an issue, the variable with the right address was computed but never used when the code was modified, and no tests are available for this feature for two reasons: 1. The Sentinel unit test currently does not test Sentinel ability to persist its state at all. 2. It is a very hard to trigger state since it lasts for little time in the context of the testing framework. However this feature should be covered in the test in some way. The bug was found by @badboy using the clang static analyzer. Effects of the bug on safety of Sentinel === This bug results in severe issues in the following case: 1. A Sentinel is elected leader. 2. During the failover, it persists a wrong config with a known-slave entry listing the master address. 3. The Sentinel crashes and restarts, reading invalid configuration from disk. 4. It sees that the slave now does not obey the logical configuration (should replicate from the current master), so it sends a SLAVEOF command to the master (since the slave master is the same) creating a replication loop (attempt to replicate from itself) which Redis is currently unable to detect. 5. This means that the master is no longer available because of the bug. However the lack of availability should be only transient (at least in my tests, but other states could be possible where the problem is not recovered automatically) because: 6. Sentinels treat masters reporting to be slaves as failing. 7. A new failover is triggered, and a slave is promoted to master. Bug lifetime === The bug is there forever. Commit 16237d78 actually tried to fix the bug but in the wrong way (the computed variable was never used! My fault). So this bug is there basically since the start of Sentinel. Since the bug is hard to trigger, I remember little reports matching this condition, but I remember at least a few. Also in automated tests where instances were stopped and restarted multiple times automatically I remember hitting this issue, however I was not able to reproduce nor to determine with the information I had at the time what was causing the issue.
* Merge pull request #2614 from linfangrong/patch-1Salvatore Sanfilippo2015-06-111-1/+1
|\ | | | | Update t_zset.c
| * Update t_zset.clinfangrong2015-06-021-1/+1
| |
* | Use best effort address binding to connect to the masterantirez2015-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We usually want to reach the master using the address of the interface Redis is bound to (via the "bind" config option). That's useful since the master will get (and publish) the slave address getting the peer name of the incoming socket connection from the slave. However, when this is not possible, for example because the slave is bound to the loopback interface but repliaces from a master accessed via an external interface, we want to still connect with the master even from a different interface: in this case it is not really important that the master will provide any other address, while it is vital to be able to replicate correctly. Related to issues #2609 and #2612.
* | anet.c: new API anetTcpNonBlockBestEffortBindConnect()antirez2015-06-112-3/+22
| | | | | | | | | | | | | | | | | | This performs a best effort source address binding attempt. If it is possible to bind the local address and still have a successful connect(), then this socket is returned. Otherwise the call is retried without source address binding attempt. Related to issues #2609 and #2612.
* | anetTcpGenericConnect(), jump to error not end on errorantirez2015-06-111-2/+2
| | | | | | | | | | | | | | Two code paths jumped to the "ok, return the socket to the user" code path to handle error conditions. Related to issues #2609 and #2612.
* | Don't try to bind the source address for MIGRATEantirez2015-06-111-2/+2
| | | | | | | | Related to issues #2609 and #2612.
* | hide access to debug tableBen Murphy2015-06-031-6/+9
| |
* | disable loading lua bytecodeBen Murphy2015-06-031-1/+1
| |
* | Scripting: Lua cmsgpack lib updated to include str8 supportantirez2015-06-031-29/+42
|/
* Merge branch 'zaddnx' into unstableantirez2015-05-292-16/+158
|\
| * Test: ZADD CH testszaddnxantirez2015-05-291-0/+7
| |
| * ZADD RETCH option renamed CHantirez2015-05-291-4/+4
| | | | | | | | | | | | | | From Twitter: "@antirez that’s an awfully-named command :( http://en.wikipedia.org/wiki/Retching"
| * Test: ZADD INCR testantirez2015-05-291-0/+14
| |
| * Test: ZADD NX and XX options testsantirez2015-05-291-0/+59
| |
| * ZADD RETCH option: Return number of elements added or updatedantirez2015-05-291-1/+4
| | | | | | | | | | | | Normally ZADD only returns the number of elements added to a sorted set, using the RETCH option it returns the sum of elements added or for which the score was updated.
| * ZADD NX and XX optionsantirez2015-05-291-6/+26
| |
| * ZADD implemenation able to take options.antirez2015-05-281-10/+49
| |
* | Merge pull request #2586 from huachaohuang/patch-1Salvatore Sanfilippo2015-05-281-1/+1
|\ \ | | | | | | Update anet.c
| * | Update anet.cHuachao Huang2015-05-211-1/+1
| | |
* | | Merge pull request #2587 from itamarhaber/patch-5Salvatore Sanfilippo2015-05-281-1/+1
|\ \ \ | |_|/ |/| | Removed incorrect suggestion
| * | Removed incorrect suggestionItamar Haber2015-05-211-1/+1
| |/ | | | | DEL/INCR/DECR and others could be NTH but apparently never made it to the implementation of SORT
* | Merge pull request #2571 from therealbill/sentinel-flushconfig-commandSalvatore Sanfilippo2015-05-251-0/+4
|\ \ | | | | | | adding a sentinel command: "flushconfig" per RCP4
| * | adding a sentinel command: "flushconfig"therealbill2015-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This new command triggers a config flush to save the in-memory config to disk. This is useful for cases of a configuration management system or a package manager wiping out your sentinel config while the process is still running - and has not yet been restarted. It can also be useful for scripting a backup and migrate or clone of a running sentinel.
* | | Sentinel: clarify effect of resetting failover_start_time.antirez2015-05-251-2/+4
| | |
* | | Sentinel: help subcommand in simulate-failure commandantirez2015-05-251-0/+4
| | |
* | | Sentinel: initial failure simulator implementedantirez2015-05-221-2/+48
| |/ |/| | | | | | | | | This commit adds the SENTINEL simulate-failure, that sets specific hooks inside the state machine that will crash Sentinel, for testing purposes.
* | Sentinel: fix sentinelTryConnectionSharing() by checking for no matchantirez2015-05-201-0/+1
| | | | | | | | Trivial omission of the obvious no-match case.
* | Merge branch 'sentinel-32' into unstableantirez2015-05-192-275/+571
|\ \
| * | Sentinel: CKQUORUM testsantirez2015-05-191-0/+34
| | |
| * | Sentinel: SENTINEL CKQUORUM commandsentinel-32antirez2015-05-181-0/+51
| | | | | | | | | | | | | | | A way for monitoring systems to check that Sentinel is technically able to reach the quorum and failover, using the currently visible Sentinels.
| * | Sentinel: port address update code to shared links logicantirez2015-05-151-2/+38
| | |
| * | Sentinel: config-rewrite unique ID just one timeantirez2015-05-141-4/+4
| | |
| * | Sentinel: remove debugging message from releaseInstanceLink()antirez2015-05-141-1/+0
| | |
| * | Sentinel: fix access to NULL link->cc in releaseInstanceLink()antirez2015-05-141-1/+1
| | |
| * | Sentinel: remove SHARED! debugging printfantirez2015-05-141-1/+0
| | |
| * | Sentinel: rewrite callback chain removing instances with shared linksantirez2015-05-141-1/+17
| | | | | | | | | | | | | | | Otherwise pending commands callbacks will fire with a reference that no longer exists.
| * | Sentinel: debugging code removed from sentinelSendPing()antirez2015-05-141-9/+0
| | |
| * | Sentinel: use active/last time for ping logicantirez2015-05-141-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PING trigger was improved again by using two fields instead of a single one to remember when the last ping was sent: 1. The "active" ping is the time at which we sent the last ping that still received no reply. However we continue to ping non replying instances even if they have an old active ping: the link may be disconnected and reconencted in the meantime so the older pings may get lost even if it's a TCP socket. 2. The "last" ping is the time at which we really sent the last ping on the wire, and this is used in order to throttle the amount of pings we send during failures (when no pong is received). All in all the failure detector effectiveness should be identical but we avoid to flood instances with pings during failures or when they are slow.
| * | Sentinel: limit reconnection frequency to the ping periodantirez2015-05-131-0/+7
| | |
| * | Sentinel: PING trigger improvedantirez2015-05-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's ok to ping as soon as the ping period has elapsed since we received the last PONG, but it's not good that we ping again if there is a pending ping... With this change we'll send a new ping if there is one pending only if two times the ping period elapsed since the ping which is still pending was sent.
| * | Sentinel: same-Sentinel link sharing across mastersantirez2015-05-121-9/+34
| | |
| * | Sentinel: add sentinelGetInstanceTypeString() fuctionantirez2015-05-121-0/+7
| | | | | | | | | | | | | | | | | | This is useful for debugging and logging activities: given a sentinelRedisInstance object returns a C string representing the instance type: master, slave, sentinel.
| * | Sentinel: add link refcount to instance descriptionantirez2015-05-111-0/+4
| | |