Comments (5)
Does it started to happen recently? Ours is having the same problem but we never changed the monstache config for 2 months its weird
from monstache.
@yunusemrecatalcam Yes we started facing issue from last 2-3 months.
from monstache.
@yunusemrecatalcam we found the issue from where it's coming. While fetching data from mongo view while processing relate, it doesn't get the record at all during insertion. We have mongo replica set deployment. I feel while writing data to mongo collection, there are services which are not configured with write majority. For now we have added retry mechanism (5 times) with some delay between iteration. But still there is going to be issue during update, it may not get latest updated record.
from monstache.
@yunusemrecatalcam I think another way to solve this is to add readPreference from primary
from monstache.
Hi,
I have a very similar problem.
im using this versions:
- Elastic v7.17.9
- Mongodb 6.0.14
- Monstache 6.7.17
This is my toml file
mongo-url="mongo-url?readPreference=primary"
config-database-name="database-monstache"
elasticsearch-urls =["url"]
elasticsearch-validate-pem-file=false
elasticsearch-user="user"
elasticsearch-password="password"
elasticsearch-max-conns = 50
change-stream-namespaces = [ "collection1","collection2","collection3"]
replay = false
resume = true
resume-name = "default"
index-as-update = true
direct-read-no-timeout = true
elasticsearch-retry = true
fail-fast = false
stats = false
verbose = true
disable-change-events = false
enable-patches = true
[[mapping]]
namespace = "collection1"
index = "index1"
[[mapping]]
namespace = "collection2"
index = "index2"
[[mapping]]
namespace = "collection3"
index = "index3"
[[script]]
namespace = "collection1"
script = """
module.exports = function(doc) {
if (doc.id) {
doc.owner = findId(doc.owner_id, {
collection: "collection1"
});
}
function removeKey(obj) {
Object.keys(obj).forEach(function(key) {
if (key === "_class") delete(obj[key]);
if (typeof obj[key] === 'object' && obj[key] !== null) {
removeKey(obj[key])
}
})
}
removeKey(doc);
function isNumber (value) {
if (value === null || value === undefined) {
return false;
}
if (typeof value === "string") {
return !isNaN(value) && !isNaN(parseFloat(value));
}
return !isNaN(value);
};
if (isNumber(doc.amount)) {
doc.amount = doc.amount * 100
}
if (isNumber(doc.presales_amount)) {
doc.presales_amount = doc.presales_amount * 100
}
return doc;
}
"""
[[relate]]
namespace = "collection1"
with-namespace = "collection2"
src-field = "_id"
match-field = "owner_id"
keep-src = true
It's happening for 5-10 records per 100 records and it's very random exactly like @sachinnagesh reported.
Have you got any suggestions?
from monstache.
Related Issues (20)
- Monstache did not back off writing data when ElasticSearch disk was full (http code 429), causing log spam HOT 3
- Can't connect Monstache(local machine) with my MongoDB containers(3 replicas) and elasticsearch containers.
- Version conflict on collection relation
- Monstache starts backoff when getting 404 (deleted object is already deleted in ES) HOT 2
- Bug: Setting mongodb field value to null does not index it in Elasticsearch HOT 5
- Add an option to include mongo change stream in health check
- Obsessive-compulsive reading disorder
- Order of monstache golang functions execution
- Is there a way to know lag / total pending sync
- decending sorting HOT 1
- Monstache monitoring HOT 2
- Migrating mongodb to ES, but lost _id ?
- Does each worker open a new change steam in monstache when it is running with multiple workers?
- cant build plugin for ARM64
- How to keep an embedded document in full sync?
- Docker container exits without error after 5 days despite restart=always
- Elasticsearch 8 with PKI auth
- How to get reference field data in transform script HOT 1
- Token resume lead to Mongo HIGH CPU usage
- How can i return multiple after comparing data?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monstache.