Skip to content

Excessive hard constraint logging statement #2940

Open
@GrantPSpencer

Description

Describe the bug

Newly added log statement regarding disabling and enabling of hard constraint level logs is printed too often, unnecessarily filling up log files. "Disabling hard constraint level logging for cluster:" is printed every time we attempt to find a node for a toBeAssignedReplica as part of ConstraintBasedAlgorithm, even if hard constraint level logging is already disabled. Similarly applies to the "Enabling hard constraint level logging for cluster:" statement even when logging is already enabled, but that is only triggered when there are WAGED rebalance failures

Host 1

$ du -sh helix.log
54G	helix.log

$ grep -c "Disabling hard constraint level logging for cluster" helix.log
79_591_258

Host 2

$ du -sh helix.log
21G	helix.log

$ grep -c "Disabling hard constraint level logging for cluster" helix.log
81_694_180

To Reproduce

N/A

Expected behavior

Refactor logic so that we only print log statement when logging state flips (ON-->OFF, OFF-->ON). Currently it will print regardless if new state is same as old state (disabling logging when already disabled)

Here's a quick thought on how we can refactor the conditional logging logic to reduce log statements
GrantPSpencer#44

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions