kfaraz commented on code in PR #16208:
URL: https://github.com/apache/druid/pull/16208#discussion_r1540412428


##########
server/src/test/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinatorTest.java:
##########
@@ -935,7 +935,12 @@ public void 
testTransactionalAnnounceFailDbNullWantNotNull() throws IOException
         new ObjectMetadata(ImmutableMap.of("foo", "bar")),
         new ObjectMetadata(ImmutableMap.of("foo", "baz"))
     );
-    Assert.assertEquals(SegmentPublishResult.fail("java.lang.RuntimeException: 
Failed to update the metadata Store. The new start metadata is ahead of last 
commited end state."), result1);
+    Assert.assertEquals(
+        SegmentPublishResult.fail(
+            "java.lang.RuntimeException: Failed to update the metadata Store."

Review Comment:
   Better just throw a `DruidException` from method 
`commitSegmentsAndMetadata()`.



##########
server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:
##########
@@ -2429,8 +2429,8 @@ protected DataStoreMetadataUpdateResult 
updateDataSourceMetadataWithHandle(
     if (!startMetadataMatchesExisting) {
       // Not in the desired start state.
       return new DataStoreMetadataUpdateResult(true, false, StringUtils.format(
-          "Inconsistent metadata state. This can happen if you update input 
topic in a spec without changing " +
-          "the supervisor name. Stored state: [%s], Target state: [%s].",
+          "Inconsistent metadata state. This can happen when the input topic 
in the supervisor spec is updated"
+          + " without resetting the supervisor. Stored state: [%s], Target 
state: [%s].",

Review Comment:
   Instead of saying, "this can happen when ...", should we clearly call out 
the possible remedy like "try doing ..." ?
   ```suggestion
             "Inconsistency between stored metadata state[%s] and target 
state[%s]. Try resetting the supervisor.",
   ```
   Also, `StringUtils.format()` is not needed here as the 
`DataStoreMetadataUpdateResult` takes a msg format and args.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to