Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void validate(RequestStatus status)

case Success:
Assertions.assertTrue(tracker.all(FastPathShardTracker::hasReachedQuorum));
Assertions.assertTrue(tracker.all(shard -> shard.fastPathIsRejected() || shard.hasMetFastPathCriteria() || shard.fastPathIsDelayed()));
Assertions.assertTrue(tracker.all(shard -> shard.hasMetFastPathCriteria() || (shard.fastPathFailures + shard.fastPathDelayed > 0) || shard.fastPathIsRejected() || shard.fastPathIsDelayed()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assertions.assertTrue(tracker.all(shard -> shard.hasMetFastPathCriteria() || (shard.fastPathFailures + shard.fastPathDelayed > 0) || shard.fastPathIsRejected() || shard.fastPathIsDelayed()));
Assertions.assertTrue(tracker.all(shard -> shard.hasMetFastPathCriteria() || shard.fastPathIsRejected() || shard.fastPathIsDelayed() || (shard.fastPathFailures + shard.fastPathDelayed > 0)));

Reordering the assert order made it harder to validate what changed in the diff

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also explain why (shard.fastPathFailures + shard.fastPathDelayed > 0)?

so we check: met fast path, fast path is rejected, fast path is delayed... so your check just says "at least 1 failure or delay exists"? can you explain the situation you found and why this is the right fix?

Assertions.assertFalse(tracker.any(FastPathShardTracker::hasFailed));
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ private boolean validToReassignRange(Topology current, Shard[] nextShards, Map<I

private boolean previousEpochForRegainedRangeRetired(Topology current, Ranges regainingRanges)
{
// In cases where nodeLookup is null, we are not testing invariants that are

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't feel this comment helps. It didn't really tell me anything so I had to walk the code to understand why its there.

What i see is that 2 code paths set null and one sets nodeMap:::get... The 2 code paths that set null do not create Node so we don't have the metadata needed to do this check...

We could have a comment like this?

When nodeLookup isn't defined we are unable to get node state, so assume that the calling test doesn't care about retired ranges

// related to this logic
if (this.nodeLookup == null)
return true;

for (Id id : current.nodes())
{
Node node = this.nodeLookup.apply(id);
Expand Down