-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Disable case-insensitive index on _User #8492
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
Comments
Thanks for opening this issue!
|
Additionally, the current code also tries to create an index on '_Idempotency' with 'ttl' set to 0 on 'expire' field when running against MongoDB. This behavior is forbidden on Azure Cosmos DB for MongoDB because (1) it force the field to be an reserved field '_ts' other than some custom field, and (2) it enforces the value of 'ttl' to be larger than 0. Not sure why the current code set 'ttl' to 0 when using MongoDB - I checked the document and found it says the value should also be positive non-zero value (just like Azure document says) See MongoDB Document So, here in the PR I just skips adding such index and I think it would not be an issue, since setting it to 0 doesn't automatically delete the expired records. |
|
In a conclusion, I'll tweak my code to be (a) having three switches on these three indexes, and (b) moving these switches to MongoDB node other than in the root node. |
@EraserKing @mtrezza may be related #8042 |
Yes, but we can't tell if that changes in the future. |
Thanks. It's the partiallly the same. For case-sensitive, my change looks the same as that PR. But to play it on Azure Cosmos, another change (TTL on expiry) is also necessary because Azure Cosmos requires TTL to be set on an internal field other than the custom field. |
@EraserKing and @mtrezza , I'll try to explore quickly if we can here just introduce a hook function instead of many little boolean. I'm not sure if it's the correct strategy in the long term since many ecosystems exists, and parse server itself will not be able to fulfill each one by default. So an inversion of control is maybe the right solution. |
Seems it is not fixing this issue, I ran the PR with the env set still getting the same error. |
@EraserKing What env bar did you set? Do you mind share? |
/* Disables behavior to ensure case-insensitive index on field username on _User collection. Set to |
New Feature / Enhancement Checklist
Current Limitation
Currently while Parse Server is starting up, on MongoDB, it tries to create a few indexes with case-sensitive on, on collection _User.
However not all MongoDB supports case-sensitive, for example, Azure Cosmos DB for Mongo does not support: Supported Indexes. This leads to Parse Server connecting to such database directly fails to start.
Feature / Enhancement Description
With switches of options / environment toggled on, skipping validating / creating such indexes. I see the options in PR #5634 but I don't know why that's not implemented finally.
Example Use Case
Alternatives / Workarounds
No. We cannot create case-insensitive indexes on Azure Cosmos DB and we cannot disable creating such indexes in Parse. Totally not working.
3rd Party References
Not necessary.
The text was updated successfully, but these errors were encountered: