Squashed commit of the following:
commit ba143668b964885ca1b2cf3af927a49bec0f14a4
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jul 7 11:53:46 2015 +0200
[Fix] aeWinQueueAccept wrong return value.
[Change] Variable name acceptsocket changed to acceptfd.
commit 75f6769fd52fe8215bd1a2149f1bd115078ea278
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jul 6 17:26:55 2015 +0200
[Fix] Closing handled before returning.
[Cleanup] Tabs->spaces.
commit 4f22c9be7dee2f34f2cbf5b8a4fd50b87b443937
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jul 6 17:15:20 2015 +0200
[Change] Removed extra space allocated at the end of the mmap file.
[Log] Improved error messages.
commit f306348c243493b192eaeee9aed404ec065bb60c
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Sat Jul 4 12:08:41 2015 +0200
[Fix] RFDMap was not thread safe.
[Cleanup] Removed unused/commented out code, tabs->spaces.
commit 8da060bf484898932f2ecd02c099266eb31d4d80
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Sat Jul 4 12:02:58 2015 +0200
[Fix] UnhandledExceptiontHandler internal exception handling.
commit 99e5e26fba4b48531cd2a544d5a22d6caba0f681
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Thu Jul 2 08:15:11 2015 +0200
[Cleanup] Removed unused include.
commit d812c4ed57cdc30cd817ad2e9181f5bf239dc07b
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 20:36:13 2015 +0200
[Cleanup] Removed useless platform definition from RedisServer.sln
commit 0401c167120876ca5533beb0bc6054d6401e8b65
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 20:32:51 2015 +0200
[Cleanup] Changed variable type to match function return value.
checkForSentinelMode() returns an int, not a bool.
commit 6a9ccd3906d5c007d4683d9caea64da78e5ed668
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 20:27:21 2015 +0200
[Cleanup] Minor change to method signature.
The method input parameter has been changed to a const.
commit e60f617b543edff46ceebb9362f01619e2188594
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 20:16:00 2015 +0200
[Cleanup] Removed non-existent file from hiredis project.
commit 8d17c3dd052083ec4e47176921337822299167b1
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 19:58:59 2015 +0200
[WinPort] Explicit cast.
commit 426841dc8c454a2afbc44c8f005cb3bf31b20cd5
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 17:07:22 2015 +0200
[Change] Move ReleasePackagingTool to its own solution.
[Cleanup] Removed unused code in ReleasePackagingTool.
[Changed] Chocolatey package now imports documents from the same folder where binaries are.
commit 6ed0696c7902d6dc268fd34f55bce95783bc4286
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jul 1 13:58:58 2015 +0200
[Fix] Ignore SymInitialize() return value to make sure Stack Trace is logged
when redis-server is running as a Windows service.
commit f5e18675c9046492e7dd5a2593c2f890627a093d
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 30 19:06:59 2015 +0200
[Change] EventLog.dll excluded from NuGet package.
commit 1ae80857b6fe1b5f352d247376c8fbbd94e81dfc
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 29 16:02:25 2015 +0200
Updated scripts to create and push the NuGet and Chocolatey packages.
- [Change] the binaries are now downloaded from the github release.
- [Change] Redis.nuspec: don't copy the files from the "documentation" folder since the documentation is already included with the binaries.
- [Fix] PullBinaries.ps1: replaced hardcoded Redis version number with input parameter.
- [Fix] improved error handling.
commit c8e70630693a4f505177623824dff998602e62b4
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 29 12:21:58 2015 +0200
Fork code for background processing needed fixes and code refactoring.
- [Fix] BeginForkOperation_Aof()/_Rdb()/_Socket() and BeginForkOperation() code
refactoring.
- [Fix] rewriteAppendOnlyFileBackground() code refactoring to minimize the code
changes for WIN32.
- [Fix] rewriteAppendOnlyFileBackground() must update the latency monitor, the
fork stats and replicationScriptCacheFlush().
- [Fix] rdbSaveBackground() code refactoring to minimize the code changes for
WIN32.
- [Fix] rdbSaveBackground() must update the latency monitor and the fork stats.
- [Fix] memory leak in rdbSaveToSlavesSockets().
- [Fix] properly releasing resources in rdbSaveToSlavesSockets().
- [Fix] QForkChildInit() not setting the operationFailed event in case of
exception.
- [Fix] QForkChildInit() AV in catch() statement.
commit f1007fcaad5ceb17d27fcca081b8dbcf8906ee92
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Fri Jun 26 11:54:09 2015 +0200
[Fix] deleting char** correctly (@zeliard)
commit b8009c220a
Author: Alexis Campailla <alexis@janeasystems.com>
Date: Wed Jun 24 23:10:27 2015 +0200
Fix 32-bit build
commit 4f384b9e58
Author: Alexis Campailla <alexis@janeasystems.com>
Date: Wed Jun 24 21:36:57 2015 +0200
Update appveyor version
commit b84d390111
Author: Alexis Campailla <alexis@janeasystems.com>
Date: Wed Jun 24 20:53:17 2015 +0200
Fix child process handle closing
commit fdbf5328c2
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 17:43:54 2015 +0200
MapViewOfFileEx() error handling, UnhandledExceptiontHandler fixes.
[log] Improved error message if MapViewOfFileEx() fails.
[fix] Child process call exist(1) if MapViewOfFileEx() fails.
[new] GetForkOperationStatus() now detects if the child process is not anymore running.
[fix] Error reporting in UnhandledExceptiontHandler() for "UNKNOWN EXCEPTION".
[new] UnhandledExceptiontHandler() now calls the default C++ unhandled exceptiont handler.
[log] Changed the closing statement of the BUG REPORT.
[comment] Removed commented out code in Win32_dlmalloc.c.
commit 05b20f0e4b
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 13:05:53 2015 +0200
Change BUG REPORT closing message to point to a different git hub page.
commit 1cb3e84814
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 11:59:45 2015 +0200
ReleasePackagingTool changes:
[change] the release notes file is not anymore generated from a template
[change] the .md files are not anymore generated from the .docx files
[new] added redis-server.pdb symbols to the zip package file
[fix] create the release package directory if it doesn't exist
commit 8ea708f9e1
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 01:21:27 2015 +0200
New release notes format (similar to Redis on UNIX)
commit e2df601222
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 01:16:02 2015 +0200
Fixed broken link in README.
commit 93d00065e4
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 24 01:12:49 2015 +0200
Minor update to the README.
commit bd2ee4d2da
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 23:40:50 2015 +0200
Warning message in config files for the maxmemory flag.
commit 2943ec7db6
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 21:56:31 2015 +0200
Cleaned up the UnhandledExceptiontHandler() code.
Minor changes.
commit b805f2be89
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 19:02:03 2015 +0200
Calling abort() in redisOutOfMemoryHandler().
Changed out-of-memory error report.
commit 18a653318d
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 18:55:53 2015 +0200
Commented out printf calls in dlmalloc.
commit f01052fb5d
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 18:44:32 2015 +0200
Changed #if defined(_WIN64) to #ifdef _WIN64
It was causing an appveyor build failure.
commit a4865f06a9
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 18:15:20 2015 +0200
'save' config flag added to the 'incompatibleNoPersistenceCommands' list.
The fix prevents redis-server from crashing if the 'save' flag is set and
'persistence-available' is set to 'no'.
commit 3de4f6cb47
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 16:54:23 2015 +0200
Change misleading variables/functions names: master->parent, slave->child.
Master and Slave labels were using for the Parent and Child processes.
commit 453b582eed
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 13:46:45 2015 +0200
Updated authors and description for nuget and chocolatey.
commit e91c9eeef7
Merge: 5c05765dc3285a
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 13:40:41 2015 +0200
Merge branch '2.8-enrico' of https://github.com/janeasystems/redis-private into 2.8-enrico
commit dc3285af0b
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 23 11:42:51 2015 +0200
Update Redis on Windows Release Notes.md
commit 5c05765d9a
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 21:23:08 2015 +0200
Typos in warning message.
commit 510cc9bd3e
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 19:57:52 2015 +0200
Replaced AddVectoredExceptionHandler with SetUnhandledExceptionFilter
for unhandled exception handling.
Added log warning if the maxmemory flag is not set.
commit 4993487b25
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 17:33:41 2015 +0200
Fixed links in README.
commit 710d179f91
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 17:25:21 2015 +0200
Added text to links.
commit 04c1ba4c56
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 17:15:48 2015 +0200
Updated documentation.
commit 019d317a10
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 13:58:40 2015 +0200
Use MEM_TOP_DOWN flag to allocate memory for memtest.
commit 3b4bd2f84e
Author: NickMRamirez <nramirez@hmbnet.com>
Date: Wed Jun 10 15:12:07 2015 -0400
Added logic to prevent firewall exception from being added if the Windows Firewall Windows service is stopped.
(cherry picked from commit 12383540c65236b2657f74178d6c2e4ec0c4d15a)
Conflicts:
msvs/msi/RedisMsi/RedisMsi.wixproj
commit 3935ffb302
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 12:35:10 2015 +0200
RejoinCOWPages and background threads should be synchronized (part 2)
commit 87e43c5ce6
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 22 11:23:04 2015 +0200
Changed error message.
commit af7ca8ca28
Author: Alexis Campailla <alexis@janeasystems.com>
Date: Fri Jun 19 21:22:48 2015 +0200
RejoinCOWPages and background threads should be synchronized
RejoinCOWPages is copying dirty pages to a new view
of the memory map.
If another thread modifies the heap between when
RejoincCOWPages copies the data and when the view is
remapped, the modification will be lost, leading to a
memory corruption.
In short, when RejoincCOWPages is running, all other
threads must be stopped.
Fixes: https://github.com/MSOpenTech/redis/issues/244
commit 3cd7d92bf3
Author: Alexis Campailla <alexis@janeasystems.com>
Date: Fri Jun 19 19:31:22 2015 +0200
Build ReleasePackagingTool in Debug for Debug solution configuration
commit 4742811f48
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Fri Jun 19 12:05:32 2015 +0200
Comment wording.
commit 2c8c937325
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Fri Jun 19 00:24:32 2015 +0200
Cleaned up a few #ifdef _WIN32.
commit 2772b6388e
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Fri Jun 19 00:22:32 2015 +0200
Indentation.
commit f8cc98586e
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Fri Jun 19 00:20:19 2015 +0200
StackTrace and info report.
commit d6ede8b354
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Thu Jun 11 17:03:08 2015 +0200
Moved RedisLog.* to Win32_Interop and renamed to Win32_RedisLog.*
Deleted unused file msvs/RedisLog.h
commit 13f36c88e0
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Thu Jun 11 16:05:41 2015 +0200
Added symbols to MSI.
Also updated the release number to 2.8.21.
commit c68970e268
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Thu Jun 11 15:30:04 2015 +0200
Enabled dlmalloc DEBUG mode in the debug build.
commit 1cf1db97ae
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 10 23:08:53 2015 +0200
Final portability fixes for 'long' type.
commit 365c4c7559
Merge: fb63c21fbb9d61
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 10 12:32:11 2015 +0200
Merge version 2.8.21 from antirez into 2.8
Changes to be committed:
modified: 00-RELEASENOTES
modified: deps/lua/src/ldo.c
modified: deps/lua/src/lua_cmsgpack.c
modified: src/scripting.c
modified: src/version.h
commit fb63c21f81
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 10 12:15:57 2015 +0200
Comment.
added a note in case 32bit support will be brought back.
commit bf260ec746
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Wed Jun 10 00:43:46 2015 +0200
Test portability fix.
the 'redis-sentinel' binary is not currently built on Windows, the quick
workaround is to call 'redis-server --sentinel'
commit 2975545e6a
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Tue Jun 9 17:21:56 2015 +0200
Restored support for the command argument --test-memory
along with -h, --help, -v, --version
commit 64c14409d9
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 8 20:40:08 2015 +0200
Added back the RealeasePackaingTool project in the RedisServer.sln build
It was removed by mistake in a previous commit.
commit eaf29cc8aa
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 8 20:35:31 2015 +0200
Truncate AOF in case of unexpected EOF.
The Win32 port was not truncating the AOF file.
commit 91d01bf8fb
Author: Enrico Giordani <enrico.giordani@gmail.com>
Date: Mon Jun 8 16:23:53 2015 +0200
Win32 portability for tests: fix the syntax to invoke 'tail'.
tail -nX file -> tail -X file
commit fbb9d619f7
Author: antirez <antirez@gmail.com>
Date: Thu Jun 4 12:00:21 2015 +0200
Fix 2.8.21 release notes to give full credits.
commit 7f8b865a65
Author: antirez <antirez@gmail.com>
Date: Thu Jun 4 11:32:24 2015 +0200
Redis 2.8.21
commit 700b863f13
Author: Ben Murphy <benmmurphy@gmail.com>
Date: Mon May 11 23:24:37 2015 +0100
hide access to debug table
commit 5a1b22ad7f
Author: Ben Murphy <benmmurphy@gmail.com>
Date: Mon May 11 23:24:24 2015 +0100
disable loading lua bytecode
commit 1eeb9bd714
Author: antirez <antirez@gmail.com>
Date: Wed Jun 3 08:44:43 2015 +0200
Scripting: Lua cmsgpack lib updated to include str8 support
Conflicts:
00-RELEASENOTES
src/version.h
tests/instances.tcl
Originally, only the +slave event which occurs when a slave is
reconfigured during sentinelResetMasterAndChangeAddress triggers a flush
of the config to disk. However, newly discovered slaves don't
apparently trigger this flush but do trigger the +slave event issuance.
So if you start up a sentinel, add a master, then add a slave to the
master (as a way to reproduce it) you'll see the +slave event issued,
but the sentinel config won't be updated with the known-slave entry.
This change makes sentinel do the flush of the config if a new slave is
deteted in sentinelRefreshInstanceInfo.
To rewrite the config in the loop that adds slaves back after a master
reset, in order to handle switching to another master, is useless: it
just adds latency since there is an fsync call in the inner loop,
without providing any additional guarantee, but the contrary, since if
after the first loop iteration the server crashes we end with just a
single slave entry losing all the other informations.
It is wiser to rewrite the config at the end when the full new
state is configured.
This fixes issue #2535, that was actually an hiredis library bug (I
submitted an issue and fix to the redis/hiredis repo as well).
When an asynchronous hiredis connection subscribes to a Pub/Sub channel
and gets an error, and in other related conditions, the function
redisProcessCallbacks() enters a code path where the link is
disconnected, however the function returns before freeing the allocated
reply object. This causes a memory leak. The memory leak was trivial to
trigger in Redis Sentinel, which uses hiredis, every time we tried to
subscribe to an instance that required a password, in case the Sentinel
was configured either with the wrong password or without password at
all. In this case, the -AUTH error caused the leaking code path to be
executed.
It was verified with Valgrind that after this change the leak no longer
happens in Sentinel with a misconfigured authentication password.
When we fail to setup the write handler it does not make sense to take
the client around, it is missing writes: whatever is a client or a slave
anyway the connection should terminated ASAP.
Moreover what the function does exactly with its return value, and in
which case the write handler is installed on the socket, was not clear,
so the functions comment are improved to make the goals of the function
more obvious.
Also related to #2485.
master was closing the connection if the RDB transfer took long time.
and also sent PINGs to the slave before it got the initial ACK, in which case the slave wouldn't be able to find the EOF marker.
rehashidx is always positive in the two code paths, since the only
negative value it could have is -1 when there is no rehashing in
progress, and the condition is explicitly checked.
Bug as old as Redis and blocking operations. It's hard to trigger since
only happens on instance role switch, but the results are quite bad
since an inconsistency between master and slave is created.
How to trigger the bug is a good description of the bug itself.
1. Client does "BLPOP mylist 0" in master.
2. Master is turned into slave, that replicates from New-Master.
3. Client does "LPUSH mylist foo" in New-Master.
4. New-Master propagates write to slave.
5. Slave receives the LPUSH, the blocked client get served.
Now Master "mylist" key has "foo", Slave "mylist" key is empty.
Highlights:
* At step "2" above, the client remains attached, basically escaping any
check performed during command dispatch: read only slave, in that case.
* At step "5" the slave (that was the master), serves the blocked client
consuming a list element, which is not consumed on the master side.
This scenario is technically likely to happen during failovers, however
since Redis Sentinel already disconnects clients using the CLIENT
command when changing the role of the instance, the bug is avoided in
Sentinel deployments.
Closes#2473.
There was a bug in Redis Cluster caused by clients blocked in a blocking
list pop operation, for keys no longer handled by the instance, or
in a condition where the cluster became down after the client blocked.
A typical situation is:
1) BLPOP <somekey> 0
2) <somekey> hash slot is resharded to another master.
The client will block forever int this case.
A symmentrical non-cluster-specific bug happens when an instance is
turned from master to slave. In that case it is more serious since this
will desynchronize data between slaves and masters. This other bug was
discovered as a side effect of thinking about the bug explained and
fixed in this commit, but will be fixed in a separated commit.
1. No need to set btype in processUnblockedClients(), since clients
flagged REDIS_UNBLOCKED should have it already cleared.
2. When putting clients in the unblocked clients list, clientsArePaused()
should flag them with REDIS_UNBLOCKED. Not strictly needed with the
current code but is more coherent.
This commit moves the process of generating a new config epoch without
consensus out of the clusterCommand() implementation, in order to make
it reusable for other reasons (current target is to have a CLUSTER
FAILOVER option forcing the failover when no master majority is
reachable).
Moreover the commit moves other functions which are similarly related to
config epochs in a new logical section of the cluster.c file, just for
clarity.
When the list of unblocked clients were processed, btype was set to
blocking type none, but the client remained flagged with REDIS_BLOCKED.
When timeout is reached (or when the client disconnects), unblocking it
will trigger an assertion.
There is no need to process pending requests from blocked clients, so
now clientsArePaused() just avoid touching blocked clients.
Close#2467.