Skip to content

Conversation

giampa91
Copy link
Contributor

@giampa91 giampa91 commented Aug 6, 2025

Description

  • Implemented broker-side request handling for deleteExporter API
  • Updated PartitionConfigurationManager and ZeebePartition to support exporter deletion

Checklist

Related issues

closes #35324

@giampa91 giampa91 requested a review from a team as a code owner August 6, 2025 21:17
@giampa91 giampa91 requested review from deepthidevaki and removed request for a team August 6, 2025 21:17
@github-actions github-actions bot added the component/zeebe Related to the Zeebe component/team label Aug 6, 2025
@giampa91
Copy link
Contributor Author

giampa91 commented Aug 6, 2025

Hi @deepthidevaki,

I noticed that I had to duplicate some logic between the disableExporter and deleteExporter paths.
If the current logic looks correct to you, I’d be happy to refactor it in a follow-up to make the implementation more DRY and reduce redundancy.

@giampa91 giampa91 force-pushed the feat/deleteExporterInBroker branch from 17ecb7e to 30ee4e6 Compare August 8, 2025 11:04
Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

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

Great 🚀 Some smaller suggestions

  • ❌ We should also handle concurrent deletion of exporters and transition of ExporterDirection. It looks like the existing code already covers this case. However, to ensure please add a test in ExporterDirectorPartitionTransisitionStepTest for concurrently deleted exporters. You can refer shouldDisableExporterIfConfigChangedConcurrently for inspiration.
  • 🔧 You can simplify most of the the assert statements as I suggested. For future you can follow this suggestion shared in the slack. you can make use of this plugin, if you are an intellij user.

Comment on lines 238 to 229
public ActorFuture<Void> deleteExporter(final String exporterId) {
return callRemoveExporter(exporterId);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can merge this with the disableExporter method.

Copy link
Contributor Author

@giampa91 giampa91 Aug 12, 2025

Choose a reason for hiding this comment

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

I call inside the deleteExporter -> disableExporter, is that's what you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can just have one public method "removeExporter" in ExporterDirector that is used for disabling and deleting.

@giampa91 giampa91 force-pushed the feat/deleteExporterInBroker branch from 30ee4e6 to 98627d0 Compare August 12, 2025 22:24
import org.junit.Rule;
import org.junit.Test;

public class ExporterDeleteTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

When we have just one method "removeExporter", there is no need for this test because it will be a duplicate of ExporterDisableTest.

@giampa91 giampa91 force-pushed the feat/deleteExporterInBroker branch 2 times, most recently from 34bf07c to c7f51f1 Compare August 13, 2025 22:50
…nda#35324)

- Implemented broker-side request handling for deleteExporter API
- Updated PartitionConfigurationManager and ZeebePartition to support exporter deletion

closes camunda#35324
update method to deleteOrDisableOrEnableExportersIfConfigChanged
in order to handle delete and not just disable or enable.
Test updated
@giampa91 giampa91 force-pushed the feat/deleteExporterInBroker branch from c7f51f1 to 01a843c Compare August 14, 2025 10:32
context.getExporterDirector().removeExporter(exporter.getId());
} else if (!currentEnabledExporters.containsKey(exporter)) {
// Exporter present but disabled → disable it
context.getExporterDirector().removeExporter(exporter.getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Is this change necessary? The previous code already handles the deleted exporters right?

@deepthidevaki
Copy link
Contributor

@giampa91 Would you have time to finish up this PR? If not I'm happy to take over and get it merged.

I would like to complete this feature by end of this week because I want to include this feature in the upcoming alpha release scheduled for next week. For the feature, we have to merge this PR and work on the one remaining issue to expose the endpoints. So I would like to merge this by EOD tomorrow at the latest. Please let me know if you have time to answer my question above and make changes if necessary. If not, I will take over and merge your PR with minor changes if necessary.

Thanks a lot for your contribution. 🚀

@giampa91
Copy link
Contributor Author

giampa91 commented Aug 19, 2025

@deepthidevaki Sorry for the late! I’m quite busy at the moment and won’t be able to take a look before tomorrow evening at the earliest 😅.

From what I can see (please correct me if I’m wrong), the feature is pretty much done and just needs some cleanup.

Please feel free to take it over of course

I’m happy to contribute 😃!

@deepthidevaki
Copy link
Contributor

@giampa91 Thanks for your reply. Then I will take over this PR and merge it.

@deepthidevaki
Copy link
Contributor

I opened a new PR #36986 with the following changes.

github-merge-queue bot pushed a commit that referenced this pull request Aug 20, 2025
## Description

When exporter is deleted, it is removed from the runtime state by the
ExporterDirector. Concurrent changes during transition are handled by
ExporterDirectorTransitionStep already. Since disable and delete behaves
similar with in ExporterDirector, the method is renamed to
"removeExporter".

The original PR for this feature is #36516 by @giampa91

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #35324
closes #35323
@deepthidevaki
Copy link
Contributor

The changes in this PR are merged via #36986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/zeebe Related to the Zeebe component/team version:8.7.12
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add broker request handler for delete exporter api
2 participants