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

feat(clients): cleanup after replaceAllObjects failure [skip-bc] #3824

Merged
merged 18 commits into from
Dec 31, 2024

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Sep 23, 2024

🧭 What and Why

DI-2928

closes algolia/algoliasearch-client-php#739

Whatever happens, at the end of the replaceAllObjects helper, the temporary index should not exists anymore.

  • java
  • javascript
  • c#
  • swift
  • ruby
  • php
  • python
  • kotlin
  • scala
  • go
  • dart

@algolia-bot
Copy link
Collaborator

algolia-bot commented Sep 23, 2024

✔️ Code generated!

Name Link
🪓 Triggered by 3df8f1a8d1fc2ffec266cb5af6db8c92b1a7e295
🍃 Generated commit 65d0c60b436cd86b11a0bbf74bd9d9c78747f968
🌲 Generated branch generated/feat/rao-cleanup
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 1654
javascript 1602
php 1484
csharp 1324
java 1123
python 1108
ruby 838
swift 736

@millotp millotp self-assigned this Oct 17, 2024
@millotp millotp changed the title feat(clients): cleanup after replaceAllObjects failure feat(clients): cleanup after replaceAllObjects failure [skip-bc] Dec 31, 2024
@millotp millotp marked this pull request as ready for review December 31, 2024 13:58
@millotp millotp requested a review from a team as a code owner December 31, 2024 13:58
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nailed it


batchResp, err := c.ChunkedBatch(tmpIndexName, objects, ACTION_ADD_OBJECT, opts...)
if err != nil {
_, _ = c.DeleteIndex(c.NewApiDeleteIndexRequest(tmpIndexName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we have a defer and it succeed, it doesn't noop? that's why you've added it everywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, we don't want to make an extra call in case the final move succeeds

@millotp millotp merged commit 37223c9 into main Dec 31, 2024
28 checks passed
@millotp millotp deleted the feat/rao-cleanup branch December 31, 2024 14:25
@millotp
Copy link
Collaborator Author

millotp commented Dec 31, 2024

thanks a lot @Fluf22 for the help !

algolia-bot added a commit that referenced this pull request Dec 31, 2024
…) (generated) [skip ci]

Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-csharp that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-dart that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-kotlin that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-ruby that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-scala that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Dec 31, 2024
…erated)

algolia/api-clients-automation#3824

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: replaceAllObjects does not clean up when it fails
4 participants