tpie icon indicating copy to clipboard operation
tpie copied to clipboard

btree iterator doesn't appear to work

Open freekvw opened this issue 9 years ago • 10 comments

The increment operation on the iterator in tpie::btree does not always terminate.

freekvw avatar Jul 20 '16 07:07 freekvw

Is this still a problem?

If so, do you have a test case?

tyilo avatar Apr 05 '18 09:04 tyilo

I just checked, and currently we crash when the iterator appears to get to the end. Jakob is working on a testcase, but isn't done yet.

freekvw avatar Apr 06 '18 06:04 freekvw

Running tpie/build/apps/siv_dump/siv_dump /tmp/dataset.siv faults while tpie/build/apps/siv_dump/siv_dump --recursive /tmp/dataset.siv succedes

example.zip

antialize avatar Apr 09 '18 08:04 antialize

I found the problem: For serialized btrees t.end() != t.end() (same with begin). I'm working on a fix.

tyilo avatar Apr 10 '18 12:04 tyilo

Should be fixed by 09a2e18d4ce3ce4f0737dc7e8421d9241c9d8473

tyilo avatar Apr 10 '18 14:04 tyilo

I don't think this fix works.

if i do

for (auto it=tree.begin(); it != tree.end(); ++it) {...}

It appears to fail as a new end node is constructed and deleted for every loop iteration. Also these lookups in unordered maps could be slow. Would it not be better to fix the comparison to use the offset?

antialize avatar Apr 10 '18 14:04 antialize

Works on my computer.

tyilo avatar Apr 10 '18 16:04 tyilo

We should not use unordred maps to cache nodes. We should fix the comparision..

antialize avatar Apr 11 '18 08:04 antialize

Fair enough, should be fixed in 1b6534f632c38d8cf1bf62cf3065c9378d97a192

tyilo avatar Apr 11 '18 11:04 tyilo

Is this still a problem?

ssoelvsten avatar Jul 27 '22 09:07 ssoelvsten