From 39630c6432ae3f06f2b66dabedebfa5c968f60fd Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Mon, 8 Aug 2016 15:27:38 -0700 Subject: [PATCH] Remove live config "precomputed_comment_sort_read_chance" This was used to gradually ramp up reads of the precomputed comment orders. We've been running for a while with this set to always read, so the setting can be removed. --- r2/example.ini | 1 - r2/r2/lib/app_globals.py | 1 - r2/r2/models/builder.py | 14 ++------------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/r2/example.ini b/r2/example.ini index 2fcf016a4..fa4c4274f 100644 --- a/r2/example.ini +++ b/r2/example.ini @@ -932,7 +932,6 @@ modmail_account_map = global_loid_experiments = # precomputed comment orders -precomputed_comment_sort_read_chance = 0 precomputed_comment_sorts = precomputed_comment_sort_min_comments = 0 precomputed_comment_suggested_sort = false diff --git a/r2/r2/lib/app_globals.py b/r2/r2/lib/app_globals.py index 344f1cc08..3c0a49308 100644 --- a/r2/r2/lib/app_globals.py +++ b/r2/r2/lib/app_globals.py @@ -387,7 +387,6 @@ class Globals(object): 'events_collector_comment_sample_rate', 'events_collector_use_gzip_chance', 'https_cert_testing_probability', - 'precomputed_comment_sort_read_chance', ], ConfigValue.tuple: [ 'fastlane_links', diff --git a/r2/r2/models/builder.py b/r2/r2/models/builder.py index b248c1159..a056c9d67 100644 --- a/r2/r2/models/builder.py +++ b/r2/r2/models/builder.py @@ -24,7 +24,7 @@ from collections import defaultdict, namedtuple from copy import deepcopy import datetime import heapq -from random import shuffle, random +from random import shuffle import time from pylons import request @@ -1082,19 +1082,9 @@ class CommentOrderer(CommentOrdererBase): if self.link.num_comments <= 0: return [] - read_chance = g.live_config["precomputed_comment_sort_read_chance"] - read_enabled = read_chance > random() - has_precomputed_order = self.should_read_cache() - if read_enabled and has_precomputed_order: + if self.should_read_cache(): with g.stats.get_timer("CommentOrderer.read_cache") as timer: return self.read_cache() - elif has_precomputed_order: - # we have precomputed order for this link/sort but did not read it - # due to random read chance. time the operation to get a direct - # comparison between reading precomputed and loading CommentTree, - # CommentScoresByLink, calculating order - with g.stats.get_timer("CommentOrderer.full_load") as timer: - return self._get_comment_order() else: if bucket == "100_plus": for sort_name, operator in SORT_OPERATOR_BY_NAME.iteritems(): -- 2.11.4.GIT