FoundationDB / fdb-record-layer

A record-oriented store built on FoundationDB
Apache License 2.0
570 stars 102 forks source link

example project currently fails to run #1347

Closed panghy closed 2 years ago

panghy commented 2 years ago

Tested against: 3a472a8630422bdb7c1c603919f6143bd29ee510

Seemingly the newly added indices are disabled rather than in write only mode.

2021-07-31 05:02:13,341 [DEBUG] c.a.f.r.p.f.FDBDatabaseFactory - Starting FDB
2021-07-31 05:02:13,404 [DEBUG] c.a.f.r.p.f.FDBDatabase - Opening FDB cluster="null"
2021-07-31 05:02:13,455 [INFO] c.a.f.r.s.Main - Clearing the Record Store ...
2021-07-31 05:02:13,720 [DEBUG] c.a.f.r.p.f.FDBReverseDirectoryCache - Put unnecessary, found path 'record-layer-sample'' in reverse lookup for value '16'
2021-07-31 05:02:14,456 [INFO] c.a.f.r.s.Main - Writing Vendor and Item record ...
2021-07-31 05:02:14,577 [INFO] c.a.f.r.p.f.FDBRecordStore - new record store format_version="7" key_space_path="/application:16->'record-layer-sample'/environment:'demo'" meta_data_version="2"
2021-07-31 05:02:14,658 [DEBUG] c.a.f.r.p.f.FDBRecordStore - version check scan found empty store key_space_path="/application:16->'record-layer-sample'/environment:'demo'"
2021-07-31 05:02:14,666 [DEBUG] c.a.f.r.p.f.FDBRecordStore - rebuilding index index_name="Item$vendor_id" index_version="1" key_space_path="/application:16->'record-layer-sample'/environment:'demo'" reason="NEW_STORE" subspace_key="Item$vendor_id"
2021-07-31 05:02:14,753 [DEBUG] c.a.f.r.p.f.FDBRecordStore - rebuilding index index_name="Customer$phone_number" index_version="2" key_space_path="/application:16->'record-layer-sample'/environment:'demo'" reason="NEW_STORE" subspace_key="Customer$phone_number"
2021-07-31 05:02:14,759 [DEBUG] c.a.f.r.p.f.FDBRecordStore - indexes need rebuilding indexesReadable="[Item$vendor_id, Customer$phone_number]" key_space_path="/application:16->'record-layer-sample'/environment:'demo'" new_store="true" record_count="0"
2021-07-31 05:02:14,820 [INFO] c.a.f.r.s.Main - Reading Vendor record with primary key 9375L ...
2021-07-31 05:02:14,848 [INFO] c.a.f.r.s.Main -     Result -> Id: 9375, Name: Acme
2021-07-31 05:02:14,848 [INFO] c.a.f.r.s.Main - Looking for item IDs with vendor ID 9375L ...
2021-07-31 05:02:15,086 [INFO] c.a.f.r.s.Main -     Result -> Vendor ID: 9375, Item ID: 4836
2021-07-31 05:02:15,087 [INFO] c.a.f.r.s.Main - Grouping items by vendor ...
2021-07-31 05:02:15,213 [INFO] c.a.f.r.s.Main -     Result -> Vendor Name: Buy n Large, Item names: [Piles of Garbage, Personal Transport]
2021-07-31 05:02:15,213 [INFO] c.a.f.r.s.Main -     Result -> Vendor Name: Acme, Item names: [GPS]
2021-07-31 05:02:15,226 [INFO] c.a.f.r.p.f.FDBRecordStore - meta-data version changed key_space_path="/application:16->'record-layer-sample'/environment:'demo'" new_version="8" old_version="2"
2021-07-31 05:02:15,230 [INFO] c.a.f.r.p.f.FDBRecordStore - version check scan found non-empty store key_space_path="/application:16->'record-layer-sample'/environment:'demo'"
2021-07-31 05:02:15,235 [DEBUG] c.a.f.r.p.f.FDBRecordStore - indexes need rebuilding indexesDisabled="[email_address, globalCount, item_quantity_sum, preference_tag, preference_tag_count, order]" key_space_path="/application:16->'record-layer-sample'/environment:'demo'" record_count="unknown"
2021-07-31 05:02:15,238 [INFO] c.a.f.r.s.Main - Running index builds of new indexes:
2021-07-31 05:02:15,240 [INFO] c.a.f.r.s.Main - Adding records with new secondary indexes ...
Exception in thread "main" java.util.concurrent.CompletionException: com.apple.foundationdb.record.AggregateFunctionNotSupportedException: Aggregate function requires appropriate index
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
    at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:870)
    at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
    at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
    at com.apple.foundationdb.record.provider.foundationdb.FDBDatabaseRunnerImpl$RunRetriable.lambda$runAsync$5(FDBDatabaseRunnerImpl.java:282)
    at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
    at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
    at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
    at com.apple.foundationdb.async.AsyncUtil$LoopPartial.apply(AsyncUtil.java:350)
    at com.apple.foundationdb.async.AsyncUtil$LoopPartial.apply(AsyncUtil.java:332)
    at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
    at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
    at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: com.apple.foundationdb.record.AggregateFunctionNotSupportedException: Aggregate function requires appropriate index
    at com.apple.foundationdb.record.provider.foundationdb.FDBRecordStore.lambda$evaluateAggregateFunction$40(FDBRecordStore.java:1681)
    at java.base/java.util.Optional.orElseThrow(Optional.java:408)
    at com.apple.foundationdb.record.provider.foundationdb.FDBRecordStore.evaluateAggregateFunction(FDBRecordStore.java:1678)
    at com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.evaluateAggregateFunction(FDBRecordStoreBase.java:1536)
    at com.apple.foundationdb.record.provider.foundationdb.FDBRecordStore.getSnapshotRecordCount(FDBRecordStore.java:1596)
    at com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase.getSnapshotRecordCount(FDBRecordStoreBase.java:1394)
    at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
    ... 12 more
    Suppressed: java.util.concurrent.CompletionException: com.apple.foundationdb.record.AggregateFunctionNotSupportedException: Aggregate function requires appropriate index
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1081)
        ... 12 more
    Caused by: [CIRCULAR REFERENCE: com.apple.foundationdb.record.AggregateFunctionNotSupportedException: Aggregate function requires appropriate index]
panghy commented 2 years ago

This is from @alecgrieser https://github.com/FoundationDB/fdb-record-layer/issues/1213