Transactional Behavior
Hello, I have a business case in which I need to be able for the rollback. When I tried add/commit I was not able to prevent other threads that write to a given Solr core from committing everything. I also tried indexwriter but Solr did not get changes until we restart it. -- Regards, Amr Ali City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt Ext: 278
RE: Transactional Behavior
Please check this https://lucene.apache.org/solr/4_1_0/solr-solrj/org/apache/solr/client/solrj/SolrServer.html#rollback() "Note that this is not a true rollback as in databases. Content you have previously added may have been committed due to autoCommit, buffer full, other client performing a commit etc." It is not a real rollback if you have two threads T1 and T2 that are adding. If T1 is adding 500 and T2 is adding 3 then T2 will commit its 3 document PLUS the documents added by T1 (because T2 will finish add/commit before T2 due to the documents number). Solr transactions are "server side" only. -- Regards, Amr Ali City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt Ext: 278 -Original Message- From: Jack Krupansky [mailto:jack.krupan...@gmail.com] Sent: Tuesday, May 12, 2015 10:24 PM To: solr-user@lucene.apache.org Subject: Re: Transactional Behavior Solr does have a command, but it is an expert feature and not so clear how it works in SolrCloud. See: https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers and https://wiki.apache.org/solr/UpdateXmlMessages#A.22rollback.22 -- Jack Krupansky On Tue, May 12, 2015 at 12:58 PM, Amr Ali wrote: > Hello, > > I have a business case in which I need to be able for the rollback. > When I tried add/commit I was not able to prevent other threads that > write to a given Solr core from committing everything. I also tried > indexwriter but Solr did not get changes until we restart it. > > > -- > Regards, > Amr Ali > > City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt > Ext: 278 > > >
RE: Transactional Behavior
Hello Emir, But this is not a transaction because if some of the bulk I need to add is committed; they will be searchable. In a transaction I need to insert a bulk of data (all bulk data will be searchable once) or roll it back according to some business scenarios. -- Regards, Amr Ali City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt Ext: 278 -Original Message- From: Emir Arnautovic [mailto:emir.arnauto...@sematext.com] Sent: Tuesday, May 12, 2015 10:46 PM To: solr-user@lucene.apache.org Subject: Re: Transactional Behavior Hi Amr, One option is to include transaction id in your documents and do delete in case of failed transaction. It is not cheap option - additional field if you don't have something to use to identify transaction. Assuming rollback will not happen to often deleting is not that big issue. Thanks, Emir -- Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & Elasticsearch Support * http://sematext.com/ On 12.05.2015 22:37, Amr Ali wrote: > Please check this > > https://lucene.apache.org/solr/4_1_0/solr-solrj/org/apache/solr/client/solrj/SolrServer.html#rollback() > "Note that this is not a true rollback as in databases. Content you have > previously added may have been committed due to autoCommit, buffer full, > other client performing a commit etc." > > It is not a real rollback if you have two threads T1 and T2 that are adding. > If T1 is adding 500 and T2 is adding 3 then T2 will commit its 3 document > PLUS the documents added by T1 (because T2 will finish add/commit before T2 > due to the documents number). Solr transactions are "server side" only. > > > -- > Regards, > Amr Ali > > City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt > Ext: 278 > > > > -Original Message- > From: Jack Krupansky [mailto:jack.krupan...@gmail.com] > Sent: Tuesday, May 12, 2015 10:24 PM > To: solr-user@lucene.apache.org > Subject: Re: Transactional Behavior > > Solr does have a command, but it is an expert feature and not so > clear how it works in SolrCloud. > > See: > https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers > and > https://wiki.apache.org/solr/UpdateXmlMessages#A.22rollback.22 > > > -- Jack Krupansky > > On Tue, May 12, 2015 at 12:58 PM, Amr Ali wrote: > >> Hello, >> >> I have a business case in which I need to be able for the rollback. >> When I tried add/commit I was not able to prevent other threads that >> write to a given Solr core from committing everything. I also tried >> indexwriter but Solr did not get changes until we restart it. >> >> >> -- >> Regards, >> Amr Ali >> >> City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt >> Ext: 278 >> >> >> -- Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & Elasticsearch Support * http://sematext.com/
RE: Transactional Behavior
Hello guys, Any expert advice this issue? -- Regards, Amr Ali City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt Ext: 278 -Original Message- From: Amr Ali Sent: Wednesday, May 13, 2015 10:58 AM To: solr-user@lucene.apache.org Subject: RE: Transactional Behavior Hello Emir, But this is not a transaction because if some of the bulk I need to add is committed; they will be searchable. In a transaction I need to insert a bulk of data (all bulk data will be searchable once) or roll it back according to some business scenarios. -- Regards, Amr Ali City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt Ext: 278 -Original Message- From: Emir Arnautovic [mailto:emir.arnauto...@sematext.com] Sent: Tuesday, May 12, 2015 10:46 PM To: solr-user@lucene.apache.org Subject: Re: Transactional Behavior Hi Amr, One option is to include transaction id in your documents and do delete in case of failed transaction. It is not cheap option - additional field if you don't have something to use to identify transaction. Assuming rollback will not happen to often deleting is not that big issue. Thanks, Emir -- Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & Elasticsearch Support * http://sematext.com/ On 12.05.2015 22:37, Amr Ali wrote: > Please check this > > https://lucene.apache.org/solr/4_1_0/solr-solrj/org/apache/solr/client > /solrj/SolrServer.html#rollback() "Note that this is not a true > rollback as in databases. Content you have previously added may have been > committed due to autoCommit, buffer full, other client performing a commit > etc." > > It is not a real rollback if you have two threads T1 and T2 that are adding. > If T1 is adding 500 and T2 is adding 3 then T2 will commit its 3 document > PLUS the documents added by T1 (because T2 will finish add/commit before T2 > due to the documents number). Solr transactions are "server side" only. > > > -- > Regards, > Amr Ali > > City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt > Ext: 278 > > > > -Original Message- > From: Jack Krupansky [mailto:jack.krupan...@gmail.com] > Sent: Tuesday, May 12, 2015 10:24 PM > To: solr-user@lucene.apache.org > Subject: Re: Transactional Behavior > > Solr does have a command, but it is an expert feature and not so > clear how it works in SolrCloud. > > See: > https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+I > ndex+Handlers > and > https://wiki.apache.org/solr/UpdateXmlMessages#A.22rollback.22 > > > -- Jack Krupansky > > On Tue, May 12, 2015 at 12:58 PM, Amr Ali wrote: > >> Hello, >> >> I have a business case in which I need to be able for the rollback. >> When I tried add/commit I was not able to prevent other threads that >> write to a given Solr core from committing everything. I also tried >> indexwriter but Solr did not get changes until we restart it. >> >> >> -- >> Regards, >> Amr Ali >> >> City stars capital 8 - 3rd floor, Nasr city, Cairo, Egypt >> Ext: 278 >> >> >> -- Monitoring * Alerting * Anomaly Detection * Centralized Log Management Solr & Elasticsearch Support * http://sematext.com/