Skip to content

Commit 0ebe6f2

Browse files
author
Matt Byrd
committed
add check around read guardrail to avoid enum-set allocation similarly to write path
1 parent 2e3441e commit 0ebe6f2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/java/org/apache/cassandra/cql3/statements/SelectStatement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ public ResultMessage.Rows execute(QueryState state, QueryOptions options, Dispat
369369
checkNotNull(cl, "Invalid empty consistency level");
370370

371371
cl.validateForRead();
372-
Guardrails.readConsistencyLevels.guard(EnumSet.of(cl), state.getClientState());
372+
if Guardrails.readConsistencyLevels.enabled(clientState)
373+
Guardrails.readConsistencyLevels.guard(EnumSet.of(cl), state.getClientState());
373374

374375
long nowInSec = options.getNowInSeconds(state);
375376
int userLimit = getLimit(options);

0 commit comments

Comments
 (0)