Fix a race condition in the '/tasks' Overlord API (#12330)
authorJihoon Son <jihoonson@apache.org>
Thu, 17 Mar 2022 01:47:45 +0000 (10:47 +0900)
committerGitHub <noreply@github.com>
Thu, 17 Mar 2022 01:47:45 +0000 (10:47 +0900)
commit5e23674fe53339308ba1caaca48a80e7c9680da7
tree7abc9a4dbcb196366165e3c0b68e03e3b4115cff
parentd745d0b3384f4649a07195ee317a6a086f91329f
Fix a race condition in the '/tasks' Overlord API (#12330)

* finds complete and active tasks from the same snapshot

* overlord resource

* unit test

* integration test

* javadoc and cleanup

* more cleanup

* fix test and add more
23 files changed:
core/src/main/java/org/apache/druid/indexer/RunnerTaskState.java
core/src/main/java/org/apache/druid/indexer/TaskInfo.java
core/src/main/java/org/apache/druid/indexer/TaskStatus.java
core/src/main/java/org/apache/druid/indexer/TaskStatusPlus.java
core/src/main/java/org/apache/druid/metadata/MetadataStorageActionHandler.java
core/src/main/java/org/apache/druid/metadata/TaskLookup.java [new file with mode: 0644]
core/src/test/java/org/apache/druid/metadata/TaskLookupTest.java [new file with mode: 0644]
indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java
indexing-service/src/main/java/org/apache/druid/indexing/overlord/MetadataTaskStorage.java
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskStorage.java
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskStorageQueryAdapter.java
indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java
indexing-service/src/test/java/org/apache/druid/indexing/overlord/http/OverlordResourceTest.java
integration-tests/src/main/java/org/apache/druid/testing/clients/OverlordResourceTestClient.java
integration-tests/src/test/java/org/apache/druid/tests/api/ITOverlordResourceNotFoundTest.java [moved from integration-tests/src/test/java/org/apache/druid/tests/query/ITOverlordResourceTest.java with 97% similarity]
integration-tests/src/test/java/org/apache/druid/tests/api/ITOverlordResourceTest.java [new file with mode: 0644]
integration-tests/src/test/resources/api/overlord-resource-test-task.json [new file with mode: 0644]
server/src/main/java/org/apache/druid/metadata/DerbyMetadataStorageActionHandler.java
server/src/main/java/org/apache/druid/metadata/MySQLMetadataStorageActionHandler.java
server/src/main/java/org/apache/druid/metadata/PostgreSQLMetadataStorageActionHandler.java
server/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java
server/src/main/java/org/apache/druid/metadata/SQLServerMetadataStorageActionHandler.java
server/src/test/java/org/apache/druid/metadata/SQLMetadataStorageActionHandlerTest.java