aboutsummaryrefslogtreecommitdiffstats
path: root/src/binlog.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-24 20:25:54 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-24 20:25:54 +0400
commita3fa4d672341fd2f1888d3a2f2ed85ae57913b78 (patch)
tree352c634bbbc74cf17644545ace66a8feedc841c3 /src/binlog.c
parent63725086863e4f422340479f83dd7ef374613e76 (diff)
downloadrspamd-a3fa4d672341fd2f1888d3a2f2ed85ae57913b78.tar.gz
rspamd-a3fa4d672341fd2f1888d3a2f2ed85ae57913b78.zip
* Welcome 0.4.0
Uncompatible changes: - Statistics is uncompatible in utf8 mode Major changes: - Improved utf8 mode - Convert all characters to lowercase in statistics - Skip URL's in statistics - Improve speed of bayes classifier by using integer arithmetics - Fixed statfiles synchronization that was broken for a long time - Synchronization is now configurable Minor changes: - Bugfixes - Removed some of legacy code - Types polishing
Diffstat (limited to 'src/binlog.c')
-rw-r--r--src/binlog.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/binlog.c b/src/binlog.c
index 76cfa0cca..2a1eb9fcb 100644
--- a/src/binlog.c
+++ b/src/binlog.c
@@ -120,7 +120,7 @@ binlog_check_file (struct rspamd_binlog *log)
return FALSE;
}
- log->cur_seq = log->cur_idx->last_index;
+ log->cur_seq = log->metaindex->last_index * BINLOG_IDX_LEN + log->cur_idx->last_index;
log->cur_time = log->cur_idx->indexes[log->cur_idx->last_index].time;
return TRUE;
@@ -425,6 +425,13 @@ binlog_sync (struct rspamd_binlog *log, guint64 from_rev, guint64 *from_time, GB
*rep = NULL;
return FALSE;
}
+ else if (from_rev > log->cur_seq) {
+ /* Slave has more actual copy, write this to log and abort sync */
+ msg_warn ("slave has more recent revision of statfile %s: %uL and our is: %uL", log->filename, from_rev, log->cur_seq);
+ *rep = NULL;
+ *from_time = 0;
+ return FALSE;
+ }
metaindex_num = from_rev / BINLOG_IDX_LEN;
/* First of all try to find this revision */