openblocks-dev / openblocks

🔥 🔥 🔥 The Open Source Retool Alternative
https://cloud.openblocks.dev
GNU Affero General Public License v3.0
5.88k stars 360 forks source link

Partial Indexes not supported #306

Closed rhuanbarreto closed 1 year ago

rhuanbarreto commented 1 year ago

I'm trying to deploy openblocks with cosmos DB for MongoDB and I can't make it work because they don't yet support partial indexes that are created during migrations in the java backend.

Is there a way to avoid/disable/not use partial indexes? Today only way to solve this is to not use azure and go for either local storage or mongodb atlas.

jerry-goodman commented 1 year ago

Hello @rhuanbarreto. We can utilize sparse indexes as an alternative to partial indexes. This feature is scheduled to be released in the upcoming hotfix version.

rhuanbarreto commented 1 year ago

If this solves the problem I can be the one testing it asap. Let me know if you need any help.

jerry-goodman commented 1 year ago

Hello @rhuanbarreto. The hotfix version has been released. Please pull the latest image for testing.

rhuanbarreto commented 1 year ago

No luck. Logs available at https://pastebin.com/X6cvFtsD

jerry-goodman commented 1 year ago

https://docs.mongock.io/v5/driver/cosmosdb/index.html#sharding-the-mongock-changelog-collection I guess this is the reason, you can try setting the executionId as the shard key.

rhuanbarreto commented 1 year ago

How can I do this? I'm zero knowledge in this actually.

jerry-goodman commented 1 year ago

I created an Azure Cosmos DB for MongoDB(4.2), but I did not reproduce this issue. May I ask what version of Cosmos DB you are using?

rhuanbarreto commented 1 year ago

Just to update the issue here so others can have info:

If you want to use Cosmosdb for MongoDB v4.2, you should use the primary/secondary key instead of RBAC, then the migrations will work.