You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/22 13:11:24 UTC

[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #16177: [improve][es-sink] Add error log for failed bulk records in ES sink

nicoloboschi commented on code in PR #16177:
URL: https://github.com/apache/pulsar/pull/16177#discussion_r903723764


##########
pulsar-io/elastic-search/src/main/java/org/apache/pulsar/io/elasticsearch/ElasticSearchClient.java:
##########
@@ -73,9 +73,16 @@ public void afterBulk(long executionId, List<BulkProcessor.BulkOperationRequest>
                 }
                 int index = 0;
                 for (BulkProcessor.BulkOperationResult result: results) {
-                    final Record record = bulkOperationList.get(index++).getPulsarRecord();
+                    final Record<?> record = bulkOperationList.get(index++).getPulsarRecord();
                     if (result.isError()) {
                         record.fail();
+
+                        log.warn("Bulk request id={} failed, message id=[{}] index={} error={}", executionId,

Review Comment:
   method `checkForIrrecoverableError` will log, ignore or throw an error for a malformed message error depending on `malformedDocAction`.
   It'd be better to move this new log inside that method and ensure to log only if it's not a `MALFORMED_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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org