Skip to content

Conversation

@wolfchkov
Copy link
Contributor

No description provided.

@wolfchkov wolfchkov force-pushed the feature/off-aerospike-enterprise-stop-writes-sys-memory-pct branch 2 times, most recently from 9297504 to bff9fc4 Compare February 14, 2024 11:55
}

private void switchOffStopWritesSysMemoryPctMetric(GenericContainer<?> aerospikeContainer) throws IOException, InterruptedException {
log.info("Switching off 'stop-writes-sys-memory-pct'...");
Copy link
Collaborator

Choose a reason for hiding this comment

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

add reason why pls

Copy link
Contributor Author

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) {
Copy link
Collaborator

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

@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",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not 16_1?

Copy link
Contributor Author

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",
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@wolfchkov wolfchkov force-pushed the feature/off-aerospike-enterprise-stop-writes-sys-memory-pct branch from bff9fc4 to 1e7df3b Compare February 14, 2024 13:13
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()));
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@wolfchkov wolfchkov force-pushed the feature/off-aerospike-enterprise-stop-writes-sys-memory-pct branch from 1e7df3b to df4ec00 Compare February 14, 2024 14:06
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));
Copy link
Collaborator

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?

Copy link
Contributor Author

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));
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@Fameing Fameing merged commit 660951a into PlaytikaOSS:support/2.3.X Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants