ColumnFamilyHandle and ImmutableListMultimaps

49 views
Skip to first unread message

Steve Lord

unread,
Jan 12, 2021, 5:47:20 PM1/12/21
to rocksdb
I'm having issues with RocksDB ColumnFamilyHandle and ImmutableListMultimap. Probably something obvious I'm doing, but any pointers appreciated. I have simplified the Java code greatly, but it produces the same error. Sometime the test produces no exceptions and sometimes it does, but not consistently given the same number of runs. Why am I doing this? This was part of a test to test a save operation multiple times but in different threads.
I am using guava 30.1-jre and RocksDB 6.13.3.

public void createMultimap() {
List<Integer> integerList = Arrays.asList(0, 1, 2); final ListMultimap<ColumnFamilyHandle, Integer> mm = Multimaps.index(integerList, l ->
store.getColumnFamilyHandle(ValueType.VALUE));
} @Test
public void saveMultiple() {
for (int i = 0; i < 2; i++) {
createMultimap();
}
}

This intermittently produces the following exception.
It appears that using RocksDB.ColumnFamilyHandle is the cause. My understanding is that ImmutableListMultimap should allow multiple objects to be stored under the same key as per: https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Multimaps.html#index-java.lang.Iterable-com.google.common.base.Function-
java.lang.IllegalArgumentException: Multiple entries with same key: org.rocksdb.ColumnFamilyHandle@6d97c642=[2] and org.rocksdb.ColumnFamilyHandle@ae6da094=[1]
at com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:211)
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:205)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:146)
at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:109)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:390)
at com.google.common.collect.ImmutableListMultimap.fromMapEntries(ImmutableListMultimap.java:373)
at com.google.common.collect.ImmutableMultimap$Builder.build(ImmutableMultimap.java:292)
at com.google.common.collect.ImmutableListMultimap$Builder.build(ImmutableListMultimap.java:302)
at com.google.common.collect.Multimaps.index(Multimaps.java:1660)
at com.google.common.collect.Multimaps.index(Multimaps.java:1612)
at com.dremio.nessie.versioned.store.rocksdb.TestRocksDBStore.createMultimap(TestRocksDBStore.java:155)
at com.dremio.nessie.versioned.store.rocksdb.TestRocksDBStore.saveMultiple(TestRocksDBStore.java:161)

Adam Retter

unread,
Jan 13, 2021, 6:35:14 AM1/13/21
to Steve Lord, rocksdb
Does this help - https://github.com/facebook/rocksdb/pull/7860
> --
> You received this message because you are subscribed to the Google Groups "rocksdb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rocksdb+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/fd49c8b0-25e2-4450-9cf7-fb02bf7c6af4n%40googlegroups.com.



--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

Steve Lord

unread,
Jan 14, 2021, 5:02:46 PM1/14/21
to rocksdb
Thank you for this pull request. I looks like it should be able to help, but I have not been able to confirm it yet.
Reply all
Reply to author
Forward
0 new messages