lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shalin Shekhar Mangar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-6224) Post soft-commit callbacks are called before soft commit actually happens
Date Wed, 22 Oct 2014 18:16:33 GMT

     [ https://issues.apache.org/jira/browse/SOLR-6224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shalin Shekhar Mangar updated SOLR-6224:
----------------------------------------
    Attachment: SOLR-6224.patch

Added an assert to make sure postSoftCommit hook was being invoked.

> Post soft-commit callbacks are called before soft commit actually happens
> -------------------------------------------------------------------------
>
>                 Key: SOLR-6224
>                 URL: https://issues.apache.org/jira/browse/SOLR-6224
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 4.9
>            Reporter: Shalin Shekhar Mangar
>            Priority: Minor
>             Fix For: 4.10
>
>         Attachments: SOLR-6224.patch, SOLR-6224.patch
>
>
> DirectUpdateHandler2 has the following code:
> {code}
> if (!cmd.softCommit) {
>           synchronized (solrCoreState.getUpdateLock()) { // sync is currently needed
to prevent preCommit
>                                 // from being called between preSoft and
>                                 // postSoft... see postSoft comments.
>             if (ulog != null) ulog.preCommit(cmd);
>           }
>           
>           // SolrCore.verbose("writer.commit() start writer=",writer);
>           if (writer.hasUncommittedChanges()) {
>             final Map<String,String> commitData = new HashMap<>();
>             commitData.put(SolrIndexWriter.COMMIT_TIME_MSEC_KEY,
>                 String.valueOf(System.currentTimeMillis()));
>             writer.setCommitData(commitData);
>             writer.commit();
>           } else {
>             log.info("No uncommitted changes. Skipping IW.commit.");
>           }
>           // SolrCore.verbose("writer.commit() end");
>           numDocsPending.set(0);
>           callPostCommitCallbacks();
>         } else {
>           callPostSoftCommitCallbacks();
>         }
> {code}
> As evident in the code above, if cmd.softCommit is true then the post soft commit hooks
are called first and the actual soft commit happens in a block of code after it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message