You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kouta Osabe <ko...@gmail.com> on 2010/11/11 17:34:18 UTC

Rollback can't be done after committing?

Hi, all

I have a question about Solr and SolrJ's rollback.

I try to rollback like below

try{
server.addBean(dto);
server.commit;
}catch(Exception e){
 if (server != null) { server.rollback();}
}

I wonder if any Exception thrown, "rollback" process is run. so all
data would not be updated.

but once commited, rollback would not be well done.

rollback correctly will be done only when "commit" process will not?

Solr and SolrJ's rollback system is not the same as any RDB's rollback?

Re: Rollback can't be done after committing?

Posted by gengshaoguang <ge...@ceopen.cn>.
Oh, Pardeep:
I don't think lucene is a advanced storage app to support rollback to a 
history check point (which would be support only in distributed system, such 
as tow phase commit or transactional web services)

						yours

On Friday, November 12, 2010 11:25:45 am Pradeep Singh wrote:
> In some cases you can rollback to a named checkpoint. I am not too sure but
> I think I read in the lucene documentation that it supported named
> checkpointing.
> 
> On Thu, Nov 11, 2010 at 7:12 PM, gengshaoguang 
<ge...@ceopen.cn>wrote:
> > Hi, Kouta:
> > Any data store does not support rollback AFTER commit, rollback works
> > only BEFORE.
> > 
> > On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
> > > Hi, all
> > > 
> > > I have a question about Solr and SolrJ's rollback.
> > > 
> > > I try to rollback like below
> > > 
> > > try{
> > > server.addBean(dto);
> > > server.commit;
> > > }catch(Exception e){
> > > 
> > >  if (server != null) { server.rollback();}
> > > 
> > > }
> > > 
> > > I wonder if any Exception thrown, "rollback" process is run. so all
> > > data would not be updated.
> > > 
> > > but once commited, rollback would not be well done.
> > > 
> > > rollback correctly will be done only when "commit" process will not?
> > > 
> > > Solr and SolrJ's rollback system is not the same as any RDB's rollback?


Re: Rollback can't be done after committing?

Posted by Lance Norskog <go...@gmail.com>.
This feature would make the ReplicationHandler more robust in its own 
practice of "reserving" previous commit points, by pushing that code out 
into Solr proper.

Jason Rutherglen wrote:
> The timed deletion policy is a bit too abstract, as is keeping a
> numbered limit of commit points.  How would one know what they're
> rolling back to when num limit is defined?
>
> I think committing to a name and being able to roll back to it in Solr
> is a good feature to add.
>
> On Fri, Nov 12, 2010 at 2:47 AM, Michael McCandless
> <lu...@mikemccandless.com>  wrote:
>    
>> In fact Lucene can rollback to a previous commit.
>>
>> You just need to use a deletion policy that preserves past commits
>> (the default policy only keeps the most recent commit).
>>
>> Once you have multiple commits in the index you can do fun things like
>> open an IndexReader on an old commit, rollback (open an IndexWriter on
>> an old commit, deleting the "future" commits).  You can even open an
>> IndexWriter on an old commit yet still preserve the newer commits, to
>> "revert" changes to the index yet preserve the history.
>>
>> You can use IndexReader.listCommits to get all commits currently in the index.
>>
>> But I'm not sure if these capabilities are exposed yet through Solr.
>>
>> Mike
>>
>> On Thu, Nov 11, 2010 at 10:25 PM, Pradeep Singh<pk...@gmail.com>  wrote:
>>      
>>> In some cases you can rollback to a named checkpoint. I am not too sure but
>>> I think I read in the lucene documentation that it supported named
>>> checkpointing.
>>>
>>> On Thu, Nov 11, 2010 at 7:12 PM, gengshaoguang<ge...@ceopen.cn>wrote:
>>>
>>>        
>>>> Hi, Kouta:
>>>> Any data store does not support rollback AFTER commit, rollback works only
>>>> BEFORE.
>>>>
>>>> On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
>>>>          
>>>>> Hi, all
>>>>>
>>>>> I have a question about Solr and SolrJ's rollback.
>>>>>
>>>>> I try to rollback like below
>>>>>
>>>>> try{
>>>>> server.addBean(dto);
>>>>> server.commit;
>>>>> }catch(Exception e){
>>>>>   if (server != null) { server.rollback();}
>>>>> }
>>>>>
>>>>> I wonder if any Exception thrown, "rollback" process is run. so all
>>>>> data would not be updated.
>>>>>
>>>>> but once commited, rollback would not be well done.
>>>>>
>>>>> rollback correctly will be done only when "commit" process will not?
>>>>>
>>>>> Solr and SolrJ's rollback system is not the same as any RDB's rollback?
>>>>>            
>>>>
>>>>          
>>>        
>>      

Re: Rollback can't be done after committing?

Posted by Jason Rutherglen <ja...@gmail.com>.
The timed deletion policy is a bit too abstract, as is keeping a
numbered limit of commit points.  How would one know what they're
rolling back to when num limit is defined?

I think committing to a name and being able to roll back to it in Solr
is a good feature to add.

On Fri, Nov 12, 2010 at 2:47 AM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> In fact Lucene can rollback to a previous commit.
>
> You just need to use a deletion policy that preserves past commits
> (the default policy only keeps the most recent commit).
>
> Once you have multiple commits in the index you can do fun things like
> open an IndexReader on an old commit, rollback (open an IndexWriter on
> an old commit, deleting the "future" commits).  You can even open an
> IndexWriter on an old commit yet still preserve the newer commits, to
> "revert" changes to the index yet preserve the history.
>
> You can use IndexReader.listCommits to get all commits currently in the index.
>
> But I'm not sure if these capabilities are exposed yet through Solr.
>
> Mike
>
> On Thu, Nov 11, 2010 at 10:25 PM, Pradeep Singh <pk...@gmail.com> wrote:
>> In some cases you can rollback to a named checkpoint. I am not too sure but
>> I think I read in the lucene documentation that it supported named
>> checkpointing.
>>
>> On Thu, Nov 11, 2010 at 7:12 PM, gengshaoguang <ge...@ceopen.cn>wrote:
>>
>>> Hi, Kouta:
>>> Any data store does not support rollback AFTER commit, rollback works only
>>> BEFORE.
>>>
>>> On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
>>> > Hi, all
>>> >
>>> > I have a question about Solr and SolrJ's rollback.
>>> >
>>> > I try to rollback like below
>>> >
>>> > try{
>>> > server.addBean(dto);
>>> > server.commit;
>>> > }catch(Exception e){
>>> >  if (server != null) { server.rollback();}
>>> > }
>>> >
>>> > I wonder if any Exception thrown, "rollback" process is run. so all
>>> > data would not be updated.
>>> >
>>> > but once commited, rollback would not be well done.
>>> >
>>> > rollback correctly will be done only when "commit" process will not?
>>> >
>>> > Solr and SolrJ's rollback system is not the same as any RDB's rollback?
>>>
>>>
>>
>

Re: Rollback can't be done after committing?

Posted by Michael McCandless <lu...@mikemccandless.com>.
In fact Lucene can rollback to a previous commit.

You just need to use a deletion policy that preserves past commits
(the default policy only keeps the most recent commit).

Once you have multiple commits in the index you can do fun things like
open an IndexReader on an old commit, rollback (open an IndexWriter on
an old commit, deleting the "future" commits).  You can even open an
IndexWriter on an old commit yet still preserve the newer commits, to
"revert" changes to the index yet preserve the history.

You can use IndexReader.listCommits to get all commits currently in the index.

But I'm not sure if these capabilities are exposed yet through Solr.

Mike

On Thu, Nov 11, 2010 at 10:25 PM, Pradeep Singh <pk...@gmail.com> wrote:
> In some cases you can rollback to a named checkpoint. I am not too sure but
> I think I read in the lucene documentation that it supported named
> checkpointing.
>
> On Thu, Nov 11, 2010 at 7:12 PM, gengshaoguang <ge...@ceopen.cn>wrote:
>
>> Hi, Kouta:
>> Any data store does not support rollback AFTER commit, rollback works only
>> BEFORE.
>>
>> On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
>> > Hi, all
>> >
>> > I have a question about Solr and SolrJ's rollback.
>> >
>> > I try to rollback like below
>> >
>> > try{
>> > server.addBean(dto);
>> > server.commit;
>> > }catch(Exception e){
>> >  if (server != null) { server.rollback();}
>> > }
>> >
>> > I wonder if any Exception thrown, "rollback" process is run. so all
>> > data would not be updated.
>> >
>> > but once commited, rollback would not be well done.
>> >
>> > rollback correctly will be done only when "commit" process will not?
>> >
>> > Solr and SolrJ's rollback system is not the same as any RDB's rollback?
>>
>>
>

Re: Rollback can't be done after committing?

Posted by Pradeep Singh <pk...@gmail.com>.
In some cases you can rollback to a named checkpoint. I am not too sure but
I think I read in the lucene documentation that it supported named
checkpointing.

On Thu, Nov 11, 2010 at 7:12 PM, gengshaoguang <ge...@ceopen.cn>wrote:

> Hi, Kouta:
> Any data store does not support rollback AFTER commit, rollback works only
> BEFORE.
>
> On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
> > Hi, all
> >
> > I have a question about Solr and SolrJ's rollback.
> >
> > I try to rollback like below
> >
> > try{
> > server.addBean(dto);
> > server.commit;
> > }catch(Exception e){
> >  if (server != null) { server.rollback();}
> > }
> >
> > I wonder if any Exception thrown, "rollback" process is run. so all
> > data would not be updated.
> >
> > but once commited, rollback would not be well done.
> >
> > rollback correctly will be done only when "commit" process will not?
> >
> > Solr and SolrJ's rollback system is not the same as any RDB's rollback?
>
>

Re: Rollback can't be done after committing?

Posted by gengshaoguang <ge...@ceopen.cn>.
Hi, Kouta:
Any data store does not support rollback AFTER commit, rollback works only 
BEFORE.

On Friday, November 12, 2010 12:34:18 am Kouta Osabe wrote:
> Hi, all
> 
> I have a question about Solr and SolrJ's rollback.
> 
> I try to rollback like below
> 
> try{
> server.addBean(dto);
> server.commit;
> }catch(Exception e){
>  if (server != null) { server.rollback();}
> }
> 
> I wonder if any Exception thrown, "rollback" process is run. so all
> data would not be updated.
> 
> but once commited, rollback would not be well done.
> 
> rollback correctly will be done only when "commit" process will not?
> 
> Solr and SolrJ's rollback system is not the same as any RDB's rollback?


Re: Rollback can't be done after committing?

Posted by Jonathan Rochkind <ro...@jhu.edu>.
What you say is true. Solr is not an rdbms.

Kouta Osabe wrote:
> Hi, all
>
> I have a question about Solr and SolrJ's rollback.
>
> I try to rollback like below
>
> try{
> server.addBean(dto);
> server.commit;
> }catch(Exception e){
>  if (server != null) { server.rollback();}
> }
>
> I wonder if any Exception thrown, "rollback" process is run. so all
> data would not be updated.
>
> but once commited, rollback would not be well done.
>
> rollback correctly will be done only when "commit" process will not?
>
> Solr and SolrJ's rollback system is not the same as any RDB's rollback?
>
>