objectbox / objectbox/objectbox-java

Upgrading from Objectbox v1.5 to v2.x fails with index on unsupported property

Aperta
#712 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Java
Stelle
4.6k
Fork
311
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Issue Basics

  • ObjectBox version: 1.5 upgrading to 2.x (2.3.4 at time of writing)
  • Reproducibility: always

Reproducing the bug

Create project with objectbox v1.5, define Object with Entity.

@Entity
public class Foo {
@Index private Double Lat;
@Index private Double Lng;
}

Compile and run project, in order to create the objectbox DB and save some instances.

Update the objectbox version in the project to 2.3.4, then update the entity by removing the @Index annotations

Update the entity to
@Entity
public class Foo {
private Double Lat;
private Double Lng;
}

Recompile and run project again. You will get the following Exception:

io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)

Description

This bug has been already mentioned and discussed in the StackOverflow Thread https://stackoverflow.com/questions/54149954/double-field-index-problem-when-upgrading-objectbox-library

Upgrading the objectbox instance from 1.5 to 2.x when having an @Index set on a Double field is impossible for existing apps.

A desired way of handling this would be to remove the @Index from the existing legacy data structure internally and let the app keep the data as before, making a migration to the new objectbox version possible and seamless.

Please fix this issue as an upgrade of the module is impossible.

Code

ObjectBox v1.5

@Entity
public class Foo {
@Index private Double Lat;
@Index private Double Lng;
}

ObjectBox v2.3.4
@Entity
public class Foo {
private Double Lat;
private Double Lng;
}

triggers runtime DbException: "io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)"

Logs & stackstraces

io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)

Misc

Is there anything special about your app?
No

May transactions or multi-threading play a role?
No

Did you find any workarounds to prevent the issue?
No workarounds found to date

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione in Java descritta nell’issue: crea un database v1.5 con campi Double indicizzati, quindi esegui l’upgrade a ObjectBox 2.3.4 dopo aver rimosso le annotazioni. Traccia la gestione della migrazione per l’indice legacy che attiva la DbException; il lavoro è concluso quando il database esistente si apre correttamente senza l’indice obsoleto e conserva i suoi dati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.