Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTL resets to 365 on every restart #74

Open
elfeffe opened this issue Jun 15, 2020 · 0 comments
Open

TTL resets to 365 on every restart #74

elfeffe opened this issue Jun 15, 2020 · 0 comments

Comments

@elfeffe
Copy link

elfeffe commented Jun 15, 2020

It reset EventTime index in MongoDB to 365 days no matter the TTL that you set.
I have a TTL of 4 years

{
"engineId": "purchase",
"dataset": {
"ttl": "1460 days",
},
"engineFactory": "com.actionml.engines.ur.UREngine",
"sparkConf": {
"master": "local",
"spark.driver-memory": "30g",
"spark.executor-memory": "30g"
},
"algorithm": {
"indicators": [
{
"name": "purchase"
},
{
"name": "view"
}
]
}
}

But it resets to 365 days on every restart.
The index exists, I even set by hand in MongoDB to 4 years, but when I restart, it changes the index to 365 days.

I can see in the logs the following:

09:36:41.458 INFO  MongoAsyncDao     - Drop index eventTime
09:36:41.556 INFO  MongoAsyncDao     - Create indexes List(Document((eventTime,BsonInt32{value=-1})) - IndexOptions{background=true, unique=false, name='eventTime', sparse=false, expireA$

Why it drop the index eventTime every time?

I see it checks:
case (iName, SingleIndex(o, isTtl), _) if isTtl && actualTtl(iName, actualIndexesInfo).forall(_.compareTo(ttl) != 0) =>

So if I set a different index ttl by hand using MongoDB GUI, it can believe TTL is different, and then drop it to recreate.

The thing is that I set TTL to 4 years in seconds on MongoDB, and then TTL in days on the config JSON file.
Can there be some small difference in seconds that oblige it to drop&recreate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant