SOLR-2895: call CommitTracker#addedDocument after document is added

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1202107 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-11-15 09:28:46 +00:00
parent 6121b823ea
commit 25731ea3f7
1 changed files with 1 additions and 2 deletions

View File

@ -143,7 +143,6 @@ public class DirectUpdateHandler2 extends UpdateHandler {
try {
commitTracker.addedDocument( cmd.commitWithin );
softCommitTracker.addedDocument( -1 ); // TODO: support commitWithin with soft update
if (cmd.overwrite) {
@ -172,7 +171,7 @@ public class DirectUpdateHandler2 extends UpdateHandler {
// allow duplicates
writer.addDocument(cmd.getLuceneDocument());
}
commitTracker.addedDocument( cmd.commitWithin );
// Add to the transaction log *after* successfully adding to the index, if there was no error.
// This ordering ensures that if we log it, it's definitely been added to the the index.
// This also ensures that if a commit sneaks in-between, that we know everything in a particular