-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 9.10, 10.10
-
Fix Version/s: 9.10-HF30, 10.10-HF05, 11.1, 2021.0
-
Component/s: Events / Works
When scheduling a Work with the StreamWorkManager the Work is serialized and sent into a Nuxeo stream Record.
The record has a maximum size limit that depends on the Nuxeo Stream implementation (1MB for Kafka, same for Chronicle Queue by default).
Even if this limit can be tuned at the backend level, it is not recommended to enable a very big record (bigger than ~10MB) for performance reason.
This means that we want to make sure that Works are always serialized with limited size.
Some change has already been made in NXP-25716 but still, there are possible cases of overflow:
- when the JSF UI Bulk File Import action is used with a large number of files. The AsyncEventExecutor attempting to create an instance of AsyncEventExecutor.ListenerWork with an event bundle containing a large number of events, the size of the work exceeds the default Kafka record size when importing 900 files:
[Transaction] Unexpected exception from afterCompletion; continuing java.lang.RuntimeException: Unable to send record: ProducerRecord ... at org.nuxeo.lib.stream.log.kafka.KafkaLogAppender.append(KafkaLogAppender.java:130) at org.nuxeo.lib.stream.log.kafka.KafkaLogAppender.append(KafkaLogAppender.java:110) at org.nuxeo.ecm.core.work.StreamWorkManager.schedule(StreamWorkManager.java: 155) at org.nuxeo.ecm.core.work.WorkManagerImpl.schedule(WorkManagerImpl.java: 717) at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor.scheduleListeners(AsyncEventExecutor.java:124) at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor.run(AsyncEventExecutor.java:92) at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEventBundle(EventServiceImpl.java:361) at org.nuxeo.ecm.core.event.impl.EventServiceImpl.handleTxCommited(EventServiceImpl.java:531) at org.nuxeo.ecm.core.event.impl.EventServiceImpl.afterCompletion(EventServiceImpl.java:512) at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:540) ... Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.RecordTooLargeException: The message is 3060227 bytes when serialized which is larger than the maximum requets size you have configured with the max.request.size configuration at org.apache.kafka.clients.producer.KafkaProducer$FutureFailuer<init>(KafkaProducer.java:1124) at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:823) ...
- Any existing custom (non Nuxeo) Work may exceed this limit.
Because we want backward compatibility we should add a workaround to support this large Work.
In the case of record overflow:
- we should warn that the serialized Work size is too big: either the work is serializing too many things by error, either it should be refactored to not pass blob or a large amount of data
- fallback to a KV storage or transient store for the record value.
Again this is a workaround until works are fixed because having the record value outside of the record have consequences:
- the log is not anymore the single source of trust
- failover based on Log replication will depend on an additional storage replication
- retention of the additional storage must match the Log retention
- constant throughput will be impaired by mixing very different record sizes and access
- causes
-
NXP-27303 Overflow record filter should handle records with duplicate key
- Resolved
-
NXP-27269 Fix configuration variables' names in StreamWorkManager
- Resolved
- depends on
-
NXP-27176 Backport improvement in Configuration Service
- Resolved
- is duplicated by
-
NXP-26987 Allow to configure stream producer
- Resolved
- is related to
-
NXP-30796 Avoid Record overflow during csvExport containing huge metadata
- Resolved
-
NXP-32246 Enable large Work to be serialized by default
- Resolved