Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating index (error on compacting) #1844

Open
johny65 opened this issue Nov 29, 2024 · 6 comments
Open

Error creating index (error on compacting) #1844

johny65 opened this issue Nov 29, 2024 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@johny65
Copy link

johny65 commented Nov 29, 2024

ArcadeDB Version:

24.11.1 (ArcadeDB Server v24.11.1 (build b466f48/1730841732933/main))

OS and JDK Version:

Ubuntu 24.10, JDK 21.0.5 (Linux 6.11.0-8-generic - OpenJDK 64-Bit Server VM 21.0.5 (Temurin-21.0.5+11))

Expected behavior

To create an index successfully (with SQL create index on Type(prop) notunique).

Actual behavior

I have a document type AuditLog with 135+ millions of documents, when I execute create index sentence on a property, in the server logs several times it logs something like this:

[LSMTreeIndex] - Creating a new entry in index 'AuditLog_0_95902170898792(9)' root page [#8652:23621]->94 (entry in page=93 threadId=75)...............Error on executing compaction of index 'AuditLog_0_95902170898792'
java.lang.IllegalArgumentException: Invalid position -4472603 (size=2097144)
	at com.arcadedb.database.Binary.position(Binary.java:170)
	at com.arcadedb.database.Binary.putByteArray(Binary.java:291)
	at com.arcadedb.index.lsm.LSMTreeIndexCompacted.appendDuringCompaction(LSMTreeIndexCompacted.java:125)
	at com.arcadedb.index.lsm.LSMTreeIndexCompactor.compact(LSMTreeIndexCompactor.java:234)
	at com.arcadedb.index.lsm.LSMTreeIndex.compact(LSMTreeIndex.java:231)
	at com.arcadedb.database.async.DatabaseAsyncIndexCompaction.execute(DatabaseAsyncIndexCompaction.java:43)
	at com.arcadedb.database.async.DatabaseAsyncExecutorImpl$AsyncThread.run(DatabaseAsyncExecutorImpl.java:136)

The process continues despite the errors. When I run a select that would use the index, the server logs:

[FetchFromTypeExecutionStep] <ArcadeDB_0> Attempt to scan type 'AuditLog' of total size 47,61GB 1 times. This operation is very expensive, consider using an index

Steps to reproduce

I dont't know if it's occurred because of something in the data or why.

Note:

Running select count(*) from Type on a type with millions of documents, is very slow... on my AuditLog type previously mentioned, counting documents takes several minutes... is this slow counting so by design?

@lvca
Copy link
Contributor

lvca commented Nov 30, 2024

Counting should be instantaneous, unless you have a WHERE condition.

About the compaction error, could you please try to rebuild the index with the rebuild index command?

@lvca lvca self-assigned this Nov 30, 2024
@lvca lvca added the bug Something isn't working label Nov 30, 2024
@lvca lvca added this to the 24.12.1 milestone Nov 30, 2024
@johny65
Copy link
Author

johny65 commented Dec 2, 2024

Hi. Rebuilding the index keeps throwing the same errors...

Counting should be instantaneous, unless you have a WHERE condition.

Counting from Console is indeed instantaneous:

{auditdb}> select count(*) from AuditLog

+--------+---------+
|NAME    |VALUE    |
+--------+---------+
|count(*)|135787733|
+--------+---------+
Command executed in 32ms

But same count on Studio, it takes several minutes. On this case, server logs:

[FetchFromTypeExecutionStep] <ArcadeDB_0> Attempt to scan type 'AuditLog' of total size 47,61GB 1 times. This operation is very expensive, consider using an index

@lvca
Copy link
Contributor

lvca commented Dec 2, 2024

Commands executed from Studio are adding a default limit to avoid the browser crashes with thousands or more records to render. For this reason, I think the optimizer is not smart enough and it simply scans the whole type. It's a bug, checking into the code.

@lvca
Copy link
Contributor

lvca commented Dec 2, 2024

About the compaction error, I'd love to have those files. Is it possible to have zipped?

@johny65
Copy link
Author

johny65 commented Dec 3, 2024

I can share you a reduced version of the database where the error can be replicated. Where or how do I send it to you?

@lvca
Copy link
Contributor

lvca commented Dec 3, 2024

Could you please send it to support at arcadedata dot com? Thanks!

@lvca lvca modified the milestones: 24.12.1, 25.1.1 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants