- 
                Notifications
    You must be signed in to change notification settings 
- Fork 244
switch off stop-writes-sys-memory-pct metric for aerosspike enterprise #1761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch off stop-writes-sys-memory-pct metric for aerosspike enterprise #1761
Conversation
9297504    to
    bff9fc4      
    Compare
  
    | } | ||
|  | ||
| private void switchOffStopWritesSysMemoryPctMetric(GenericContainer<?> aerospikeContainer) throws IOException, InterruptedException { | ||
| log.info("Switching off 'stop-writes-sys-memory-pct'..."); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add reason why pls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| Container.ExecResult result = aerospikeContainer.execInContainer("asadm", "--enable", "-e", | ||
| String.format("manage config namespace %s param stop-writes-sys-memory-pct to 100", namespace)); | ||
| logStdout(result); | ||
| if (result.getExitCode() != 0) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit code check does not show much - let's try to match the correct output, if not - fail
        
          
                ...stcontainers/aerospike/enterprise/ValidateEnterpriseAerospikeBootstrapConfigurationTest.java
          
            Show resolved
            Hide resolved
        
      | @Test | ||
| void skipValidation() { | ||
| contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike-server:6.1.0.16_1", | ||
| contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike-server:6.1.0.16", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not 16_1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it just checks version format, no matter
| private void switchOffStopWritesSysMemoryPctMetric(GenericContainer<?> aerospikeContainer) throws IOException, InterruptedException { | ||
| log.info("Switching off 'stop-writes-sys-memory-pct'..."); | ||
| String namespace = aerospikeProperties.getNamespace(); | ||
| Container.ExecResult result = aerospikeContainer.execInContainer("asadm", "--enable", "-e", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract common logic into method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bff9fc4    to
    1e7df3b      
    Compare
  
    | Container.ExecResult result = aerospikeContainer.execInContainer("asadm", "--enable", "-e", command); | ||
| logStdout(result); | ||
| if (result.getExitCode() != 0 || isBadResponse(result)) { | ||
| throw new IllegalStateException(String.format("Failed to execute asadm --enable -e '%s': %s", command, result.getStderr())); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log both stdout & stderr.
I'd do like something like this:
String delimiter = "-".repeat(40); String.format("Failed to execute....'%s'\nStdout:%s%s%s\nStdErr:%s%s%s", command, delimiter, result.getStdout(), delimiter, delimiter, result.getStdErr(), delimiter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1e7df3b    to
    df4ec00      
    Compare
  
    | Documentation: https://aerospike.com/docs/server/reference/configuration#stop-writes-sys-memory-pct | ||
| */ | ||
| log.info("Switching off 'stop-writes-sys-memory-pct'... "); | ||
| asadmCommandExecutor.execute(String.format("manage config namespace %s param stop-writes-sys-memory-pct to 100", namespace)); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you check execute the result of the command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is checked in AsadmCommandExecutor
|  | ||
| if (enterpriseProperties.isDurableDeletes()) { | ||
| log.info("Setting up 'disallow-expunge' to true..."); | ||
| asadmCommandExecutor.execute(String.format("manage config namespace %s param disallow-expunge to true", namespace)); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you check execute the result of the command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is checked in AsadmCommandExecutor
No description provided.