You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Vadim Gritsenko <va...@verizon.net> on 2002/01/11 20:03:26 UTC

Resource deletion issues

Hi,

While testing XIndice CVS version (yesterday), I found an issue with
deleting resources. I had following test:

0. Create empty collection
   xindiceadmin ac -c /db -n test
1. Add 905 XML resources (small set, total size is 300Kb) in one burst
2. Delete all these resources. While deleting documents, there are 7
errors like:
   Resource 2001-10-06-004 does not exist!
3. Check that collection is empty:
   xindiceadmin ld -c /db/test
4. Surprise: it shows 7 documents, which now could not be deleted:

C:\Apache\xml-xindice\bin>xindiceadmin rd -c /db/photos -n
2000-06-17-013
ERROR : Document not found!


Attached is the program which does (1) and (2).

What could be the reason for such behavior?
Where to look to find this reason?

Vadim

Re: Resource deletion issues

Posted by Tom Bradford <br...@dbxmlgroup.com>.
On Saturday, January 12, 2002, at 10:10 AM, Vadim Gritsenko wrote:
> Actually, it's in BTree$BTreeNode class. The problem how I see it with
> the values which are *exactly* matching branch separators, i.e.
> binarySearch() > 0. In this case, instead of going to the next branch
> (idx++), it currently goes to the previous branch (idx), which does not
> have this element (see getSeparator(): parts of value2 are used as
> separator, and value2 is the first element of next leaf, not first one).

Thanks for the diff.  It will probably be a few days before I apply it 
because I want to root around for more potential problems in the BTree 
implementation.

I also want to revisit multiple file descriptors and page locking at 
some point.  That may wait until after 1.0, but I'm sure people consider 
this very important (as I do).  I took it out because we were having a 
lot of concurrent access problems, so it seemed easier to get the actual 
functional implementation working for before the concurrent 
implementation.

> I hope that fix I made works correctly (not sure about rightIdx though),
> but you as an author/one of the authors of this class should know this
> better (btw, where is @author? :).

Yeah, we should start adding that since there are more than two cooks in 
the kitchen now.

--
Tom Bradford - http://www.tbradford.org
Developer - Apache Xindice (Native XML Database) - http://xml.apache.org
Creator - Project Labrador (Web Services) - http://xml-labrador.sf.net


RE: Resource deletion issues

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Tom Bradford [mailto:bradford@dbxmlgroup.com]
> 
> On Friday, January 11, 2002, at 12:03 PM, Vadim Gritsenko wrote:
> > Attached is the program which does (1) and (2).
> >
> > What could be the reason for such behavior?
> 
> A bug :-)

Ok. I found this nasty creature.

 
> > Where to look to find this reason?
> 
> Probably in the Paged.java class, but it may also be in the BTreeFiler
> class (though I doubt it).

Actually, it's in BTree$BTreeNode class. The problem how I see it with
the values which are *exactly* matching branch separators, i.e.
binarySearch() > 0. In this case, instead of going to the next branch
(idx++), it currently goes to the previous branch (idx), which does not
have this element (see getSeparator(): parts of value2 are used as
separator, and value2 is the first element of next leaf, not first one).

I hope that fix I made works correctly (not sure about rightIdx though),
but you as an author/one of the authors of this class should know this
better (btw, where is @author? :).

Regards,
Vadim


Re: Resource deletion issues

Posted by Tom Bradford <br...@dbxmlgroup.com>.
On Friday, January 11, 2002, at 12:03 PM, Vadim Gritsenko wrote:
> Attached is the program which does (1) and (2).
>
> What could be the reason for such behavior?

A bug :-)

> Where to look to find this reason?

Probably in the Paged.java class, but it may also be in the BTreeFiler 
class (though I doubt it).

--
Tom Bradford - http://www.tbradford.org
Developer - Apache Xindice (Native XML Database)
Creator - Project Labrador (Web Services Framework)