Skip to content

Commit

Permalink
Ensure proper tracking of metadata version
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 3, 2024
1 parent 0dc2151 commit 3888a9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static Mode get(Settings settings) {
public void updateConfiguration(SecurityDynamicConfiguration<RoleV7> rolesConfiguration) {
try {
if (rolesConfiguration != null) {
DlsFlsProcessedConfig oldConfig = this.dlsFlsProcessedConfig.getAndSet(
this.dlsFlsProcessedConfig.set(
new DlsFlsProcessedConfig(
DynamicConfigFactory.addStatics(rolesConfiguration.clone()),
clusterService.state().metadata().getIndicesLookup(),
Expand All @@ -688,10 +688,6 @@ public void updateConfiguration(SecurityDynamicConfiguration<RoleV7> rolesConfig
fieldMaskingConfig
)
);

if (oldConfig != null) {
oldConfig.shutdown();
}
}
} catch (Exception e) {
log.error("Error while updating DLS/FLS configuration with {}", rolesConfiguration, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected void updateClusterStateMetadata(Metadata metadata) {
long duration = System.currentTimeMillis() - start;

log.debug("Updating DlsFlsProcessedConfig took {} ms", duration);
this.metadataVersionEffective = metadata.version();
}

@Override
Expand Down

0 comments on commit 3888a9f

Please sign in to comment.