[
https://issues.apache.org/jira/browse/SOLR-5932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13965278#comment-13965278
]
Gunnlaugur Thor Briem commented on SOLR-5932:
---------------------------------------------
One way to do this generically: define a set of exception predicates, e.g.
{{retry_on_errors}} or something like that, which could be set or augmented in
configuration. Each might be as simple as a regular expression to be matched
against the exception message. When an exception is caught, the predicates are
iterated and each applied to the exception. If a predicate evaluates as true
(there's a match), then the exception is identified as one for which a retry is
appropriate, and the import operation continues (unless the error repeats;
maybe N retries with an exponential backoff, in case of a DB restart or
momentary network hiccup or such).
That's reasonably general, i.e. not specific to any one DB engine, and can be
extended by users by adding a regexp in an appropriate spot in
{{db-data-config.xml}}
> DIH: retry query on "terminating connection due to conflict with recovery"
> --------------------------------------------------------------------------
>
> Key: SOLR-5932
> URL: https://issues.apache.org/jira/browse/SOLR-5932
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Affects Versions: 4.7
> Reporter: Gunnlaugur Thor Briem
> Priority: Minor
>
> When running DIH against a hot-standby PostgreSQL database, one may randomly
> see queries fail with this error:
> {code}
> org.apache.solr.handler.dataimport.DataImportHandlerException:
> org.postgresql.util.PSQLException: FATAL: terminating connection due to
> conflict with recovery
> Detail: User query might have needed to see row versions that must be
> removed.
> Hint: In a moment you should be able to reconnect to the database and
> repeat your command.
> {code}
> A reasonable course of action in this case is to catch the error and retry.
> This would support the use case of doing an initial (possibly lengthy) clean
> full-import against a hot-standby server, and then just running incremental
> dataimports against the master.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]