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 Norberto Meijome <fr...@meijome.net> on 2008/08/12 07:48:39 UTC
adds / delete within same 'transaction'..
Hello :)
I *think* i know the answer, but i'd like to confirm :
Say I have
<doc><id>1<id/><name>old</name></doc>
already indexed and commited (ie, 'live' )
What happens if I issue:
<delete><id>1</id></delete>
<add><doc><id>1</id><name>new</name></doc>
<commit/>
will delete happen first, and then the add, or could it be that the add happens before delete, in which case i end up with no more doc id=1 ?
thanks!!
B
_________________________
{Beto|Norberto|Numard} Meijome
Anyone who isn't confused here doesn't really understand what's going on.
I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.
Re: adds / delete within same 'transaction'..
Posted by Norberto Meijome <fr...@meijome.net>.
On Tue, 12 Aug 2008 20:53:12 -0400
"Yonik Seeley" <yo...@apache.org> wrote:
> On Tue, Aug 12, 2008 at 1:48 AM, Norberto Meijome <fr...@meijome.net> wrote:
> > What happens if I issue:
> >
> > <delete><id>1</id></delete>
> > <add><doc><id>1</id><name>new</name></doc>
> > <commit/>
> >
> > will delete happen first, and then the add, or could it be that the add happens before delete
>
> Doesn't matter... it's an implementation detail. Solr used to buffer
> deletes, and if it crashed at the right time one could get duplicates.
> Now, Lucene does the buffering of deletes (internally lucene does the
> adds first and buffers the deletes until a segment flush) and it
> should be impossible to see more than one "1" or no "1" at all.
Thanks Yonik. I wasn't asking about the specific details, but of the consequence. I seem to remember (incorrectly , or v1.2 only maybe) , that if one wanted assurances that the case above happened in the right order, one had to commit after the deletes, and once more after the adds.
This not being the case, I am happy :)
Thanks again,
B
_________________________
{Beto|Norberto|Numard} Meijome
"He has Van Gogh's ear for music."
Billy Wilder
I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.
Re: adds / delete within same 'transaction'..
Posted by Yonik Seeley <yo...@apache.org>.
On Tue, Aug 12, 2008 at 1:48 AM, Norberto Meijome <fr...@meijome.net> wrote:
> What happens if I issue:
>
> <delete><id>1</id></delete>
> <add><doc><id>1</id><name>new</name></doc>
> <commit/>
>
> will delete happen first, and then the add, or could it be that the add happens before delete
Doesn't matter... it's an implementation detail. Solr used to buffer
deletes, and if it crashed at the right time one could get duplicates.
Now, Lucene does the buffering of deletes (internally lucene does the
adds first and buffers the deletes until a segment flush) and it
should be impossible to see more than one "1" or no "1" at all.
-Yonik
Re: adds / delete within same 'transaction'..
Posted by Norberto Meijome <fr...@meijome.net>.
On Tue, 12 Aug 2008 11:21:50 -0700
Mike Klaas <mi...@gmail.com> wrote:
> > will delete happen first, and then the add, or could it be that the
> > add happens before delete, in which case i end up with no more doc
> > id=1 ?
>
> As long as you are sending these requests on the same thread, they
> will occur in order.
>
> -Mike
right, that is GREAT to know then :)
cheers,
b
_________________________
{Beto|Norberto|Numard} Meijome
Life is not measured by the number of breaths we take, but by the moments that take our breath away.
I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.
Re: adds / delete within same 'transaction'..
Posted by Mike Klaas <mi...@gmail.com>.
On 11-Aug-08, at 10:48 PM, Norberto Meijome wrote:
> Hello :)
>
> I *think* i know the answer, but i'd like to confirm :
>
> Say I have
> <doc><id>1<id/><name>old</name></doc>
>
> already indexed and commited (ie, 'live' )
>
> What happens if I issue:
>
> <delete><id>1</id></delete>
> <add><doc><id>1</id><name>new</name></doc>
> <commit/>
>
> will delete happen first, and then the add, or could it be that the
> add happens before delete, in which case i end up with no more doc
> id=1 ?
As long as you are sending these requests on the same thread, they
will occur in order.
-Mike