final long ttf = termsEnum.totalTermFreq(); // get a new long value
// add value up for all fields, field is a string
// BytesWrap is a immutable object simply wrapping a bytes array
final Fun.Tuple2<String, BytesWrap> fieldTerm = Fun.t2(field, bw.clone());
Long oldValue = idxTermsMap.putIfAbsent(fieldTerm, ttf);
if (oldValue != null) {
for (;;) {
oldValue = idxTermsMap.get(fieldTerm);
if (idxTermsMap.replace(fieldTerm, oldValue, oldValue + ttf)) { // exception cause
break;
}
}
}
It is a bug. I opened new issue:
https://github.com/jankotek/MapDB/issues/304
Could you post full stack trace? I recently fixed bunch of similar concurrent issues. But non in BTreeMap itself.
Jan
--
You received this message because you are subscribed to the Google Groups "MapDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapdb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
I started with simple test case (attached), it does not reproduce.
So I will need some help to replicate this issue:
* You mentioned immutability, so I assume you know how MapDB handles that
* Are you positive that BytesWrap implements Comparable correctly? ArrayIndexOOBE could be caused by incorrect comparators.
Use `Fun.BYTE_ARRAY_COMPARATOR` if you are not sure.
* Are there other modifications performed on map. Most importantly removals?
* Try to disable cache.
* Try to enable async writes.
* Try on-heap mode, it does not use serialization:
DB db = new DB(new StoreHeap());
Thats all for now,
Jan
Hi,
I started with simple test case (attached), it does not reproduce.
So I will need some help to replicate this issue:
* You mentioned immutability, so I assume you know how MapDB handles that
* Are you positive that BytesWrap implements Comparable correctly? ArrayIndexOOBE could be caused by incorrect comparators.
Use `Fun.BYTE_ARRAY_COMPARATOR` if you are not sure.
* Are there other modifications performed on map. Most importantly removals?
* Try to disable cache.
* Try to enable async writes.
* Try on-heap mode, it does not use serialization:
DB db = new DB(new StoreHeap());
To unsubscribe from this group and stop receiving emails from it, send an email to mapdb+unsubscribe@googlegroups.com.
This could indicate that node size is somehow wrongly written. Or your serializer reads more/less bytes than it used to serialize key or value.
How does it work if you use BTreeKeySerializer.TUPLE2 as key serializer?
J
--
You received this message because you are subscribed to the Google Groups "MapDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapdb+un...@googlegroups.com.
Hi,
This is now fixed in snapshot, it was caused by typo, similar bug was in `put` method as well.
More details:
https://github.com/jankotek/MapDB/issues/304
thanks for your help and bug report,