Closed Kaimlo closed 11 years ago
Hmm... shard key(exclude_broken_fields) seems broken. The simple solution is ignoring the document when exclude_broken_fields are broken.
What do you think?
Another solution is using
Hum, what's the best for you? The goal is to not lose insert request into mongo.
fluent-plugin-mongo is designed on the assumption that an incoming event is valid as BSON. It's a MongoDB limitation, so __broken_data approach is the last resort...
The best is secondary mongod or other output plugin is needed.
Because if shard key is broken, out_mongo can't send the request to mongos.
The problem is current Fluentd doesn't support the direct
Ignoring document is very simple solution.
In fact, some users use ignore_invalid_document true
to ignore.
But it depends on the data type...
Ok so I will just use ignore_invalid_document true
for now.
All went ok after this patch https://github.com/fluent/fluent-plugin-mongo/issues/22#issuecomment-12267557 Until I get another error :
It appear sometimes while inserting and makes fluentd crash, when exclude_broken_fields option is set. I didn't find a way to dump insert requests that contain wrong UTF8