Skip to content
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

When updating the primaryKey, if the previous primaryKey value has already been used for a document, the API returns an index_primary_key_already_exists error -> ASYNC #3385

Closed
Tracked by #3352
curquiza opened this issue Jan 18, 2023 · 8 comments · Fixed by #3412
Assignees
Labels
bug Something isn't working as expected v1.0.0 PRs/issues solved in v1.0.0 released on 2023-02-06
Milestone

Comments

@curquiza
Copy link
Member

No description provided.

@curquiza curquiza added this to the v1.0.0 milestone Jan 18, 2023
@curquiza curquiza added the bug Something isn't working as expected label Jan 18, 2023
@irevoire irevoire self-assigned this Jan 19, 2023
@irevoire
Copy link
Member

Not sure we actually want to « fix » this.
It would stop us from autobatching every time there is a pk change 🤔

@curquiza
Copy link
Member Author

I'm not sure to get the relation with auto-batching

@irevoire
Copy link
Member

Basically, if an index doesn't have a pk (or doesn't exists yet) when we need to select which tasks will be batched together, we have nothing to rely on to know which task will correctly set the primary key, and thus, we can't autobatch any two tasks that don't share the same pk.

Maybe that's the kind of thing we like, though, I don't really know what to think of it

@curquiza
Copy link
Member Author

Maybe you need to inform @gmourier about this because I'm pretty sure that returning a index_primary_key_already_exists when the pk already exist is an expectation from the specifications.

@irevoire
Copy link
Member

Yeah, I already told him about it, but he doesn't have the time rn; I guess we'll see next week what we want to do with it.
I don't think it'll be hard to implement whichever solution we choose so it should be ok to do it next week

@curquiza
Copy link
Member Author

We can wait for next week, no problem

@irevoire
Copy link
Member

It has been decided to merge it because, most of the time it shouldn't be an issue

bors bot added a commit that referenced this issue Jan 24, 2023
3412: When adding documents, trying to update the primary-key now throw an error r=Kerollmops a=irevoire

While updating the test suite, I also noticed an issue with the indexed_documents value of failed tasks and had to update it. I also named a bunch of snapshots that had no name, sorry 😬

Fixes #3385
Fixes #3411

Co-authored-by: Tamo <tamo@meilisearch.com>
@curquiza
Copy link
Member Author

Closed by #3412

@meili-bot meili-bot added the v1.0.0 PRs/issues solved in v1.0.0 released on 2023-02-06 label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected v1.0.0 PRs/issues solved in v1.0.0 released on 2023-02-06
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants