NOTE: we were using the old key to get a lock on updating the
memoized result, but will now use the new key to get the lock. This
means that during the deploy we can have multiple processes updating
the memoized result. This is inefficient but should be fine.
The note on the registration page is stored in the wiki and is fronted
by memoizecache because it is loaded very frequently (it's on the login
page). Stale the cache lookup to reduce the number of requests that
fall through to memoizecache. It's currently requested ~1600/s.
Adding them to the tree doesn't hurt anything--they still won't be
displayed until their parent comment is in the tree, but it does allow
for easier cleanup in case comments get processed out of order. Once their
parent is added to the tree everything will be consistent and fine.
The CommentTree is updated first, then it is read within write_comment_orders.
There's no issue of eventual consistency so the read will always get the
most up to date version of the CommentTree.
_rel_cache is used to store (t1, t2, name) --> rel_id to make
Relation._fast_query work without falling through to a postgres
query. Reducing the TTL will let us recover from inconsistencies
more quickly, but we'll have to watch to make sure the more frequent
expirations don't put too much pressure on postgres.
In the case of cache outages the values in cache can become out of
sync with reality. If a subreddit is created during an outage it will
be impossible to access it with Subreddit._by_name until the cache is
corrected. Setting a TTL will ensure this happens eventually.
Plugins must meet the following requirements in order to be installed
on a Vagrant build:
1. Be listed in `plugins` in the Vagrantfile
2. Be cloned to the designated install directory
3. Adhere to plugin naming conventions
This applies to all open-source plugins.
This reverts commit 32dece6abec82be66d034905720203da6ee12bf7.
I had an incorrect assumption that the number of updates to permacache
significantly contributes to the instability we were having with cassandra.
Other changes to comment tree processing have made cassandra more stable so
all this does is slow down updates unnecessarily.
This check is related to the code for the upcoming "User Promoted Posts"
(see https://redd.it/4upf11), which hasn't been open-sourced yet. So
this attr doesn't exist yet, and isn't working. This should be removed
for now but can be added back in when the rest of the code is
open-sourced.
GET_flairlisting sets `USER_DOESNT_EXIST` error if the chosen user is nonexistent, however it's not rendering due to FlairPane checking for a `('USER_DOESNT_EXIST', 'name')` error by mistake. This commit resolves the issue.
add_comments is the consumer for commentstree_q and processed batches of
comments from multiple links. Previously on encountering an
InconsistentCommentTreeError we would return immediately and not process
the rest of the comments in the batch. This created additional inconsistent
CommentTrees.
This will allow us to disable tracking karma for certain accounts
(specifically AutoModerator) to prevent the size of their Account
object from ballooning due to a huge number of karma attributes.
This changes "link karma" to "post karma" in user-visible places:
* The sidebar on user profile pages
* The tooltip for hovering over the number in the header
* The check name in AutoModerator (but adds an alias for "link_karma" so
old rules will continue to work)
This commit starts giving and tracking karma for self-posts as well as
link posts. The karma is stored separately internally, but displayed and
otherwise treated as part of link karma. This will allow us to easily
revert this change and go back to the original link-only karma values if
desired.
Trophy._fast_query is never used, and Trophy overrides the "name"
property so _fast_query wouldn't work if it were used. Also the "name"
is set to the string representation of the creation time so it contains
whitespace characters which are not allowed in cache keys.