leventov commented on a change in pull request #7306: Reconcile terminology and
method naming to 'used/unused segments'; Rename MetadataSegmentManager to
MetadataSegments
URL: https://github.com/apache/incubator-druid/pull/7306#discussion_r276986014
##########
File path:
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java
##########
@@ -235,8 +231,8 @@ public Response deleteDataSource(
.build();
}
} else {
- if (!databaseSegmentManager.removeDataSource(dataSourceName)) {
- return Response.noContent().build();
+ if
(!segmentsMetadata.tryMarkAsUnusedAllSegmentsInDataSource(dataSourceName)) {
+ return Response.serverError().build();
Review comment:
@surekhasaharan right. I've changed the bahaviour of these REST endpoints to
return normally
`{"segmentStateChanged": true/false}`
and
`{"numChangedSegments": <number>}`
on idempotent operations.
I think this would also allow detecting non-existent segments or data source
names because they return `{"segmentStateChanged": false}` and
`{"numChangedSegments": 0}` respectively.
On the other hand, database errors are still exposed as 500 internal server
errors.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]