Skip to content

Commit

Permalink
5xx Exceptions: Updating CL_LOCAL_QUORUM to CL_TWO (#820)
Browse files Browse the repository at this point in the history
* updatedcltwo_final

* updatedcltwo_final_consistency
  • Loading branch information
mukeshsbbv authored Mar 5, 2024
1 parent e59d42b commit 9ba296c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,14 @@ public void readNewer(String channel, EventSink sink) {
private Iterator<Column<ByteBuffer>> readManifestForChannel(final String channel, final boolean weak) {
final ByteBuffer oldestSlab = weak ? _oldestSlab.getIfPresent(channel) : null;
final ConsistencyLevel consistency;

RangeBuilder range = new RangeBuilder().setLimit(50);

if (oldestSlab != null) {
range.setStart(oldestSlab);
consistency = ConsistencyLevel.CL_LOCAL_ONE;
consistency = ConsistencyLevel.CL_LOCAL_ONE;
} else {
consistency = ConsistencyLevel.CL_TWO;
consistency = ConsistencyLevel.CL_TWO;
}

final Iterator<Column<ByteBuffer>> manifestColumns = executePaginated(
Expand Down Expand Up @@ -398,8 +400,11 @@ private boolean readSlab(String channel, ByteBuffer slabId, SlabCursor cursor, b
// Event add and delete write with local quorum, so read with local quorum to get a consistent view of things.
// Using a lower consistency level could result in (a) duplicate events because we miss deletes and (b)
// incorrectly closing or deleting slabs when slabs look empty if we miss adds.


ColumnList<Integer> eventColumns = execute(
_keyspace.prepareQuery(ColumnFamilies.SLAB, ConsistencyLevel.CL_TWO)

_keyspace.prepareQuery(ColumnFamilies.SLAB, ConsistencyLevel.CL_TWO)
.getKey(slabId)
.withColumnRange(start, Constants.OPEN_SLAB_MARKER, false, Integer.MAX_VALUE));

Expand Down

0 comments on commit 9ba296c

Please sign in to comment.