dovecot-2.2: fts-solr: Don't update "last indexed UID" if we cou...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 13 13:48:14 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5483aeb1ce9b
changeset: 18676:5483aeb1ce9b
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 13 16:46:14 2015 +0300
description:
fts-solr: Don't update "last indexed UID" if we couldn't actually add the mails to Solr.

diffstat:

 src/plugins/fts-solr/fts-backend-solr.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 52cdf321fa07 -r 5483aeb1ce9b src/plugins/fts-solr/fts-backend-solr.c
--- a/src/plugins/fts-solr/fts-backend-solr.c	Wed May 13 16:22:27 2015 +0300
+++ b/src/plugins/fts-solr/fts-backend-solr.c	Wed May 13 16:46:14 2015 +0300
@@ -401,7 +401,12 @@
 	const char *box_guid;
 
 	if (ctx->prev_uid != 0) {
-		fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
+		/* flush solr between mailboxes, so we don't wrongly update
+		   last_uid before we know it has succeeded */
+		if (fts_backed_solr_build_commit(ctx) < 0)
+			_ctx->failed = TRUE;
+		else if (!_ctx->failed)
+			fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
 		ctx->prev_uid = 0;
 	}
 


More information about the dovecot-cvs mailing list