Compare commits

...

3 Commits

Author SHA1 Message Date
Tomasz Poradowski
fd77bb01a6 avoid using unintialized variable
fixes #47
2020-01-15 21:50:38 +01:00
tporadowski
286389b403 Redis for Windows 4.0.14.1 2020-01-15 21:04:42 +01:00
Tomasz Poradowski
5a40a37c23 workaround for issue #46
- in Windows prior to 8 and Server 2012 there is no GetSystemTimePreciseAsFileTime(), so in case of
  very fast forking - we take 100ms for calculation of "stat_fork_rate"
- fixes #46
2019-12-28 13:00:53 +01:00
8 changed files with 30 additions and 8 deletions

Binary file not shown.

View File

@@ -21,7 +21,7 @@
<Product Id="*"
Name="Redis on Windows"
Language="1033"
Version="4.0.14"
Version="4.0.14.1"
Manufacturer="Poradowski.com"
UpgradeCode="{05410198-7212-4FC4-B7C8-AFEFC3DA0FBC}">
<Package InstallerVersion="200"

View File

@@ -3,7 +3,7 @@
<metadata>
<id>redis-64</id>
<title>Redis 64-bit</title>
<version>4.0.14</version>
<version>4.0.14.1</version>
<authors>Alexis Campailla, Enrico Giordani, Jonathan Pickett</authors>
<owners>Microsoft Open Technologies, Inc.</owners>
<description>A porting of Redis on Windows 64-bit.

View File

@@ -3,7 +3,7 @@
<metadata>
<id>redis-64</id>
<title>Redis 64-bit</title>
<version>4.0.14</version>
<version>4.0.14.1</version>
<authors>Alexis Campailla, Enrico Giordani, Jonathan Pickett</authors>
<owners>Microsoft Open Technologies, Inc.</owners>
<description>A porting of Redis on Windows 64-bit.

View File

@@ -621,7 +621,8 @@ void ParseCommandLineArguments(int argc, char** argv) {
string confFilePath;
for (int n = (confFile ? 2 : 1); n < argc; n++) {
if (string(argv[n]).substr(0, 2) == "--") {
string argument = string(argv[n]).substr(2, argument.length() - 2);
string argumentString = string(argv[n]);
string argument = argumentString.substr(2, argumentString.length() - 2);
transform(argument.begin(), argument.end(), argument.begin(), ::tolower);
// Some -- arguments are passed directly to redis.c::main()

View File

@@ -1489,7 +1489,14 @@ int rewriteAppendOnlyFileBackground(void) {
#endif
/* Parent */
server.stat_fork_time = ustime()-start;
server.stat_fork_rate = (double) (zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024)); /* GB per second. */ WIN_PORT_FIX
//[tporadowski/redis] issue #46: ustime() -> gettimeofday_highres() uses GetSystemTimePreciseAsFileTime when available (Windows 8, Windows Server 2012) or
// falls back to GetSystemTimeAsFileTime which does not have such high resolution, so "stat_fork_time" may be 0 here
#ifdef _WIN32
if (server.stat_fork_time == 0) {
server.stat_fork_time = 100000; //let's pretend it took 100ms (100000 microseconds)
}
#endif
server.stat_fork_rate = (double)(zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024 * 1024 * 1024)); /* GB per second. */ WIN_PORT_FIX
latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000);
if (childpid == -1) {
closeChildInfoPipe();

View File

@@ -1127,7 +1127,14 @@ int rdbSaveBackground(char *filename, rdbSaveInfo *rsi) {
#endif
/* Parent */
server.stat_fork_time = ustime()-start;
server.stat_fork_rate = (double) (zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024)); /* GB per second. */
//[tporadowski/redis] issue #46: ustime() -> gettimeofday_highres() uses GetSystemTimePreciseAsFileTime when available (Windows 8, Windows Server 2012) or
// falls back to GetSystemTimeAsFileTime which does not have such high resolution, so "stat_fork_time" may be 0 here
#ifdef _WIN32
if (server.stat_fork_time == 0) {
server.stat_fork_time = 100000; //let's pretend it took 100ms (100000 microseconds)
}
#endif
server.stat_fork_rate = (double)(zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024 * 1024 * 1024)); /* GB per second. */ WIN_PORT_FIX
latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000);
if (childpid == -1) {
closeChildInfoPipe();
@@ -2019,7 +2026,14 @@ int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {
closeChildInfoPipe();
} else {
server.stat_fork_time = ustime()-start;
server.stat_fork_rate = (double) (zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024)); /* GB per second. */
//[tporadowski/redis] issue #46: ustime() -> gettimeofday_highres() uses GetSystemTimePreciseAsFileTime when available (Windows 8, Windows Server 2012) or
// falls back to GetSystemTimeAsFileTime which does not have such high resolution, so "stat_fork_time" may be 0 here
#ifdef _WIN32
if (server.stat_fork_time == 0) {
server.stat_fork_time = 100000; //let's pretend it took 100ms (100000 microseconds)
}
#endif
server.stat_fork_rate = (double)(zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024 * 1024 * 1024)); /* GB per second. */ WIN_PORT_FIX
latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000);
serverLog(LL_NOTICE,"Background RDB transfer started by pid %d",

View File

@@ -1 +1 @@
#define REDIS_VERSION "4.0.14"
#define REDIS_VERSION "4.0.14.1"