- Sets session ID to be a constant-sized character field inline in the
table instead of a variable-length character field compressed outside
of the row.
- Changes the session data from "json" to "jsonb" which is faster and
smaller on disk with the drawback of not maintaining key order and
whitespace (which we don't care about at all)
- Adds a clustered index on the session expiration timestamp, which will
make periodic session purging much faster.
(For an example, WTDWTF currently has 482355 sessions in the table, and
because there is no index on the expiration timestamp, PostgreSQL must
check all the rows in the table every time.)
This upgrade script can run concurrently with a live NodeBB instance,
but any action that touches sessions will wait until the upgrade script
is done.
Does not touch the database if the database driver is not set to
PostgreSQL or if there is a Redis database configured.
* WIP promisify
* promisify psql
* ability to skip some keys
* dont promisify client object
* remove async
* clone entire module so it has all properties
* add shim for node 6
* ignore sessionStore as well
* ignore pool on psql
* [test/database/list] Fix test list 4 being used in two different tests
* [database/postgres] PostgreSQL database driver
* [database/postgres] Make transactions work based on continuation scope.
* [database/postgres] Implement nested transactions
* eslint --fix
* Add database changes from earlier this week to the PostgreSQL driver.
* Fix typo
* Fix postgres.incrObjectFieldBy returning undefined instead of null when given NaN
* [database/postgres] Fix sortedSetsCard returning an array of strings.
* Update socket.io postgres adapter
* Fix PostgreSQL erroring when multiple updates are made to the same sorted set entry in a single operation.
Add a test case to catch this error.
* Fix lint errors.
* Only prune sessions on one instance in a cluster to avoid deadlocks.
They're caught and handled by the database server, but they spam the logs.
* Fix arguments.slice.
Groups.destroy can take an array of groupnames
Groups.leave can take an array of groupnames
db.incrObjectField/decrObjectField can take an array of keys
db.sortedSetRemove can take an array of keys and values
db.setRemove can take an array of keys
* [database/*] Allow databases other than Redis to provide pubsub for clustering if Redis is not present
* [pubsub] Delay messages sent before the database is ready until the database is ready.
* [pubsub] Restore old behavior of not using the database in non-clustered NodeBB instances.
See comment: https://github.com/NodeBB/NodeBB/pull/6233#issuecomment-357814968
* cache mongodb objects
remove user settings cache since it is cached at the object level
* removed indexOf from isMemberOfSets
* change has to get, change maxAge to 0