yifan-c commented on code in PR #2648:
URL: https://github.com/apache/cassandra/pull/2648#discussion_r1318866827
##########
src/java/org/apache/cassandra/auth/CIDRPermissionsCache.java:
##########
@@ -54,7 +54,7 @@ public CIDRPermissionsCache(Function<RoleResource,
CIDRPermissions> loadFunction
*/
public boolean invalidateCidrPermissions(String roleName)
{
- if (cache.getIfPresent(roleName) == null)
+ if (cache.getIfPresent(RoleResource.role(roleName)) == null)
Review Comment:
yeah. Specifically, I changed the test,
`testInvalidateSingleCidrPermission`. The assertions before and after
invalidation were missing. The updated test fails before your patch.
```java
assertThat(((CassandraCIDRAuthorizer)
DatabaseDescriptor.getCIDRAuthorizer()).has(ROLE_A)).isTrue();
// invalidate cidr permission
ToolRunner.ToolResult tool =
ToolRunner.invokeNodetool("invalidatecidrpermissionscache",
ROLE_A.getRoleName());
tool.assertOnCleanExit();
assertThat(((CassandraCIDRAuthorizer)
DatabaseDescriptor.getCIDRAuthorizer()).has(ROLE_A)).isFalse();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]