Skip to content

Vector is missing for neighbor to repair #1209

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

Open
1 task done
poldz123 opened this issue May 20, 2025 · 3 comments
Open
1 task done

Vector is missing for neighbor to repair #1209

poldz123 opened this issue May 20, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@poldz123
Copy link

poldz123 commented May 20, 2025

Is there an existing issue?

Build info

  • ObjectBox version: 4.2.0
  • OS: Android 15
  • Device/ABI/architecture: Pixel 6 Pro

Steps to reproduce

  1. Save data with vector @HnswIndex(dimensions = 2, distanceType = VectorDistanceType.GEO)
  2. Save at least a couple of thousand of them
  3. And delete all of them

Expected behavior

I should be able to remove all of them without exception.

Actual behavior

An exception is being thrown (see logs below), and the data still persists. There's currently no way to delete all of it via a query. I want to avoid clearing the entire database entity.

Code

sampleEntity.store.runInTx {
    val query = scheduleEntity.query(
        (SampleEntity_.sampleId equal operator.sampleId)
    ).build()
    query.remove()
    query.close()
}
Code
[Paste your code here]

Logs, stack traces

java.lang.IllegalStateException: Vector is missing for neighbor to repair 27900; level: 2, removed: 29219, neighbor's degree: 1
at io.objectbox.query.Query.nativeRemove(Native Method)
at io.objectbox.query.Query.lambda$remove$11$io-objectbox-query-Query(Query.java:918)
at io.objectbox.query.Query$$ExternalSyntheticLambda1.call(D8$$SyntheticClass:0)
at io.objectbox.Box.internalCallWithWriterHandle(Box.java:757)
at io.objectbox.query.Query.remove(Query.java:918)
@poldz123 poldz123 added the bug Something isn't working label May 20, 2025
@greenrobot-team
Copy link
Member

greenrobot-team commented May 26, 2025

Thanks for reporting. But please clarify: do you want to delete all of them one by one using the query you have given? Or really just one?

If you need to delete all at once, does using Box.removeAll() work?

Edit: this is unexpected, we should reproduce this and create an internal issue if needed.

@greenrobot-team greenrobot-team self-assigned this May 26, 2025
@poldz123
Copy link
Author

poldz123 commented May 29, 2025

@greenrobot-team I have multiple data within the entity with a respective ID which I only want to remove. Box.removeAll() is not possible since it removes all of the data.

I want to remove all of the data within the entity based on the ID

@greenrobot-team
Copy link
Member

@poldz123 Thanks for clarifying. I got confused because you wrote "delete all of them" multiple times.

As I said, this is not expected and we need to investigate this.

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