marcingorski commented on code in PR #87:
URL: https://github.com/apache/solr-sandbox/pull/87#discussion_r1400399571
##########
crossdc-producer/src/main/java/org/apache/solr/update/processor/MirroringUpdateProcessor.java:
##########
@@ -107,18 +110,24 @@ UpdateRequest createMirrorRequest() {
doc.removeField(CommonParams.VERSION_FIELD); // strip internal doc version
final long estimatedDocSizeInBytes = ObjectSizeEstimator.estimate(doc);
log.info("estimated doc size is {} bytes, max size is {}",
estimatedDocSizeInBytes, maxMirroringDocSizeBytes);
+
producerMirroringMetrics.getDocumentsSize().update(estimatedDocSizeInBytes);
final boolean tooLargeForKafka = estimatedDocSizeInBytes >
maxMirroringDocSizeBytes;
if (tooLargeForKafka && !indexUnmirrorableDocs) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Update
exceeds the doc-size limit and is unmirrorable. id="
+ cmd.getPrintableId() + " doc size=" + estimatedDocSizeInBytes + "
maxDocSize=" + maxMirroringDocSizeBytes);
} else if (tooLargeForKafka) {
+ producerMirroringMetrics.getTooLargeDocuments().inc();
log.warn(
"Skipping mirroring of doc {} as it exceeds the doc-size limit ({}
bytes) and is unmirrorable. doc size={}",
cmd.getPrintableId(), maxMirroringDocSizeBytes,
estimatedDocSizeInBytes);
}
- super.processAdd(cmd); // let this throw to prevent mirroring invalid reqs
+ try {
+ super.processAdd(cmd); // let this throw to prevent mirroring invalid
reqs
+ } catch (IOException exception) {
+ producerMirroringMetrics.getSavedDocuments().inc();
Review Comment:
Fixed to `local`, exception will be thrown to process it correctly.
--
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]