noobaa / noobaa-core

High-performance S3 application gateway to any backend - file / s3-compatible / multi-clouds / caching / replication ...
https://www.noobaa.io
Apache License 2.0
265 stars 78 forks source link

Indexes collisions and errors #6294

Closed jeniawhite closed 4 days ago

jeniawhite commented 3 years ago

Environment info

Actual behavior

  1. Currently, we attempt to create the index and if it fails we just do _.noop()
  2. MongoDB checks for index options collision but PostgreSQL doesn't check for that yet
  3. indexDef in PostgreSQL table is converted (not sure by which logic) to something else than what we trigger so we cannot compare. CREATE INDEX idx_btree_objectmds_bucket ON public.objectmds USING btree (((data ->> 'bucket'::text))) WHERE (((data -> 'deleted'::text) IS NULL) OR ((data -> 'deleted'::text) = 'null'::jsonb)) There is obviously an option to create a temp index and take his indexDef and then compare but it is costly.
  4. This happens when we edit existing indexes that have a name in their options.
  5. Also happens when there is an error in the DB and we somehow fail to create the index.

Expected behavior

  1. Index changes should be handled (deletion and recreation of the index with updated changes)

Steps to reproduce

  1. Create index (one that has a name in the options)
  2. Kill the system
  3. Edit the code and add more fields to the index
  4. Bring up the system and see that the index did not update

More information - Screenshots / Logs / Other output

github-actions[bot] commented 1 month ago

This issue had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.

github-actions[bot] commented 4 days ago

This issue is stale and had no activity for too long - it will now be closed.