Skip to content

Commit 769d587

Browse files
lutterFilippo Neysofu Costa
authored andcommitted
graph, store: Remove REVERSIBLE_ORDER_BY_OFF
This flag was only meant as a safety feature in case the new sort behavior causes issues. We've run with its default value for a very long time now, and can remove it.
1 parent 5c22a5c commit 769d587

File tree

2 files changed

+13
-41
lines changed

2 files changed

+13
-41
lines changed

graph/src/env/store.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ pub struct EnvVarsStore {
4343
/// only as an emergency setting for the hosted service. Remove after
4444
/// 2022-07-01 if hosted service had no issues with it being `true`
4545
pub order_by_block_range: bool,
46-
/// When the flag is present, `ORDER BY` clauses are changed so that `asc`
47-
/// and `desc` ordering produces reverse orders. Setting the flag turns the
48-
/// new, correct behavior off.
49-
///
50-
/// Set by the flag `REVERSIBLE_ORDER_BY_OFF`.
51-
pub reversible_order_by_off: bool,
5246
/// Whether to disable the notifications that feed GraphQL
5347
/// subscriptions. When the flag is set, no updates
5448
/// about entity changes will be sent to query nodes.
@@ -120,7 +114,6 @@ impl From<InnerStore> for EnvVarsStore {
120114
typea_batch_size: x.typea_batch_size,
121115
typed_children_set_size: x.typed_children_set_size,
122116
order_by_block_range: x.order_by_block_range.0,
123-
reversible_order_by_off: x.reversible_order_by_off.0,
124117
disable_subscription_notifications: x.disable_subscription_notifications.0,
125118
connection_try_always: x.connection_try_always.0,
126119
remove_unused_interval: chrono::Duration::minutes(
@@ -154,8 +147,6 @@ pub struct InnerStore {
154147
typed_children_set_size: usize,
155148
#[envconfig(from = "ORDER_BY_BLOCK_RANGE", default = "true")]
156149
order_by_block_range: EnvVarBoolean,
157-
#[envconfig(from = "REVERSIBLE_ORDER_BY_OFF", default = "false")]
158-
reversible_order_by_off: EnvVarBoolean,
159150
#[envconfig(from = "GRAPH_DISABLE_SUBSCRIPTION_NOTIFICATIONS", default = "false")]
160151
disable_subscription_notifications: EnvVarBoolean,
161152
#[envconfig(from = "GRAPH_STORE_CONNECTION_TRY_ALWAYS", default = "false")]

store/postgres/src/relational_queries.rs

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,23 +3331,13 @@ impl<'a> SortKey<'a> {
33313331
out.push_identifier(name)?;
33323332
}
33333333
}
3334-
if ENV_VARS.store.reversible_order_by_off {
3335-
// Old behavior
3336-
out.push_sql(" ");
3337-
out.push_sql(direction);
3338-
out.push_sql(" nulls last");
3339-
out.push_sql(", ");
3340-
push_prefix(rest_prefix, out);
3341-
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3342-
} else {
3343-
out.push_sql(" ");
3344-
out.push_sql(direction);
3345-
out.push_sql(", ");
3346-
push_prefix(rest_prefix, out);
3347-
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3348-
out.push_sql(" ");
3349-
out.push_sql(direction);
3350-
}
3334+
out.push_sql(" ");
3335+
out.push_sql(direction);
3336+
out.push_sql(", ");
3337+
push_prefix(rest_prefix, out);
3338+
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3339+
out.push_sql(" ");
3340+
out.push_sql(direction);
33513341
Ok(())
33523342
}
33533343

@@ -3396,21 +3386,12 @@ impl<'a> SortKey<'a> {
33963386

33973387
out.push_sql(") ");
33983388

3399-
if ENV_VARS.store.reversible_order_by_off {
3400-
// Old behavior
3401-
out.push_sql(direction);
3402-
out.push_sql(" nulls last");
3403-
out.push_sql(", ");
3404-
push_prefix(rest_prefix, out);
3405-
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3406-
} else {
3407-
out.push_sql(direction);
3408-
out.push_sql(", ");
3409-
push_prefix(rest_prefix, out);
3410-
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3411-
out.push_sql(" ");
3412-
out.push_sql(direction);
3413-
}
3389+
out.push_sql(direction);
3390+
out.push_sql(", ");
3391+
push_prefix(rest_prefix, out);
3392+
out.push_identifier(PRIMARY_KEY_COLUMN)?;
3393+
out.push_sql(" ");
3394+
out.push_sql(direction);
34143395
Ok(())
34153396
}
34163397

0 commit comments

Comments
 (0)