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

Expire tracking after 30ish days #1744

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Conversation

Martii
Copy link
Member

@Martii Martii commented Aug 25, 2020

  • We really don't need to keep this info around forever.
  • Indicate in nomenclature

Applies to #1730


Needs mitigation added ... see Automattic/mongoose#7703 (comment) and forward


I went ahead and dropped the index name and now it's at 2592000 with db.syncs.getIndexes(); with a server restart. Still doesn't explain why it was set to 7d when it's never seen that value. shrugs

Ref:

> db.syncs.getIndexes();
[
        {
                "v" : 2,
                "key" : {
                        "_id" : 1
                },
                "name" : "_id_"
        },
        {
                "v" : 2,
                "key" : {
                        "created" : 1
                },
                "name" : "created_1",
                "expireAfterSeconds" : 604800,
                "background" : true
        }
]
> db.syncs.dropIndex('created_1', function(err, result) {});
{ "nIndexesWas" : 2, "ok" : 1 }
> db.syncs.getIndexes();
[ { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_" } ]

... restart app.js ...

> db.syncs.getIndexes();
[
        {
                "v" : 2,
                "key" : {
                        "_id" : 1
                },
                "name" : "_id_"
        },
        {
                "v" : 2,
                "key" : {
                        "created" : 1
                },
                "name" : "created_1",
                "expireAfterSeconds" : 2592000,
                "background" : true
        }
]

NOTE:

  • Never use the shorthand property (7d) because it can be cast to a 32 bit Number in some packages and possibly native JavaScript.

* We really don't need to keep this info around forever.
* Indicate in nomenclature

Applies to OpenUserJS#1730
@Martii Martii added enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. DB Pertains inclusively to the Database operations. labels Aug 25, 2020
@Martii Martii merged commit 6c1036b into OpenUserJS:master Aug 25, 2020
@Martii Martii deleted the Issue-1730expiry branch August 25, 2020 12:40
@Martii Martii added the needs mitigation Needs additional followup. label Sep 2, 2020
Martii added a commit to Martii/UserScripts that referenced this pull request Sep 2, 2020
* Retest for sync track expiration from OpenUserJS/OpenUserJS.org#1744 . Should last longer than 7 days and be more like 30 days.
Martii added a commit to Martii/OpenUserJS.org that referenced this pull request Sep 6, 2020
* Possible recommendation as `expires` alias to `expireAfterSeconds` may need this to properly set values of an index that is created app side to sync with back-end.
* Increase event `emitter.setMaxListeners` to accommodate additional MongoDB usage with error thrown:

``` console
Index event triggered/trapped for User model
Index event triggered/trapped for Discussion model
Index event triggered/trapped for Strategy model
Index event triggered/trapped for Remove model
Index event triggered/trapped for Comment model
Index event triggered/trapped for Group model
Index event triggered/trapped for Flag model
Index event triggered/trapped for Vote model
(node:10567) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added to [NativeConnection]. Use emitter.setMaxListeners() to increase limit
```

Applies to OpenUserJS#1744 OpenUserJS#1730 and followup for OpenUserJS#1516 ... followup needed on mLab for index that's already there *(which I didn't put there)*
Martii added a commit that referenced this pull request Sep 6, 2020
* Possible recommendation as `expires` alias to `expireAfterSeconds` may need this to properly set values of an index that is created app side to sync with back-end.
* Increase event `emitter.setMaxListeners` to accommodate additional MongoDB usage with error thrown:

``` console
Index event triggered/trapped for User model
Index event triggered/trapped for Discussion model
Index event triggered/trapped for Strategy model
Index event triggered/trapped for Remove model
Index event triggered/trapped for Comment model
Index event triggered/trapped for Group model
Index event triggered/trapped for Flag model
Index event triggered/trapped for Vote model
(node:10567) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added to [NativeConnection]. Use emitter.setMaxListeners() to increase limit
```

Applies to #1744 #1730 and followup for #1516 ... followup needed on mLab for index that's already there *(which I didn't put there)*

Auto-merge
@Martii Martii linked an issue Sep 9, 2020 that may be closed by this pull request
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DB Pertains inclusively to the Database operations. enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. needs mitigation Needs additional followup.
Development

Successfully merging this pull request may close these issues.

WebHooks aren't being processed?
1 participant