threefoldtecharchive / jumpscaleX_core

Apache License 2.0
1 stars 6 forks source link

bcdb rebuild is not rebuilding the index correctly #390

Closed serboctor closed 4 years ago

serboctor commented 4 years ago

Steps:

JSX> farm_model = bcdb.model_get(url="tfgrid.directory.farm.1")
model:tfgrid.directory.farm.1
JSX> farm_model.find()
[## tfgrid.directory.farm.1 ID: 1

It worked for me only when I deleted the sql index file and rebuild again. Also, @andrewayoub couldnt reproduce it with the rebuild_index function on the bcdb instance. It happens only with the bcdb rebuild command.

andrewayoub commented 4 years ago

when you rum bcdb rebuild it starts a new process and since bcdb models are lazy loaded, it will only be loaded when used, that's why I had to get all objects in order to enforce loading all models before rebuilding.

https://github.com/threefoldtech/jumpscaleX_core/commit/3a67d530e16766db7695d0e3288308b4e2be156d

Dina-Abd-Elrahman commented 4 years ago

verified