Skip to content

Conversation

jedrazb
Copy link
Member

@jedrazb jedrazb commented Dec 13, 2024

Soft deletes for connectors

Add support for soft-deletes of connectors. Why?

  • In order to improve UX on connectors on agentless we need to track what connectors were deleted vs. what connector records are not yet created

Changes

  • introduce deleted flag in the connector index mappings, indicates whether connector has been soft deleted
  • adapt delete, get and list operations logic to support this feature
    • if we pass include_deleted=true flag we return also deleted connectors in the response
  • update docs
  • add yaml tests and unit tests

Related work

  • In a follow-up PR I will address adding index mapping migrations for connector index. I'm coordinating here with @navarone-feekery as he might be adding SystemIndexDecriptor for connector indices soon, this will help updating mappings a lot as there is SystemIndexMappingUpdateService
  • follow-up: support force deletes, e.g pass force=true to delete endpoint to completely remove the connector

Copy link
Contributor

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

Hi @jedrazb, I've created a changelog YAML for you.

@jedrazb
Copy link
Member Author

jedrazb commented Dec 17, 2024

@elasticmachine merge upstream

@jedrazb jedrazb marked this pull request as ready for review December 17, 2024 16:02
Copy link
Contributor

@navarone-feekery navarone-feekery left a comment

Choose a reason for hiding this comment

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

LGTM!

@jedrazb
Copy link
Member Author

jedrazb commented Dec 19, 2024

can a new Connector have an index_name value identical to a soft-deleted Connector

That was the single edge case I didn't cover because we have custom check (with query) for index names already in use ... fixed in 7525c99

Copy link
Contributor

@timgrein timgrein left a comment

Choose a reason for hiding this comment

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

Left some comments, but I think nothing preventing this PR from being merged

@jedrazb
Copy link
Member Author

jedrazb commented Dec 30, 2024

@elasticmachine merge upstream

@jedrazb
Copy link
Member Author

jedrazb commented Jan 8, 2025

New changes:

  • remove serialisation by wire for Connector class and get/list actions (since it's not needed) same as in Make the Get API keys API local only #105497
  • rename REST param deleted to include_deleted in get/list actions as IMO it conveys its purpose better

@jedrazb
Copy link
Member Author

jedrazb commented Jan 9, 2025

@elasticmachine merge upstream

Copy link
Contributor

@navarone-feekery navarone-feekery left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few questions, nothing blocking.

@jedrazb
Copy link
Member Author

jedrazb commented Jan 9, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Collaborator

merge conflict between base and head

…ub.com:jedrazb/elasticsearch into support-soft-deletes-connectors-change-mapping
@jedrazb jedrazb enabled auto-merge (squash) January 9, 2025 11:53
@jedrazb jedrazb merged commit 750a0ab into elastic:main Jan 9, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>feature :SearchOrg/Extract&Transform Label for the Search E&T team Team:Search - Extract & Transform Team:SearchOrg Meta label for the Search Org (Enterprise Search) v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants