Fix accumulo init: Prevent false positives from ZooKeeper hostname and fix Alluxio worker initialization #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The accumulo initialization has multiple critical bugs preventing it from working correctly:
Issue 1: False Positives in Instance Detection
The initialization logic has a bug that causes false positives when checking if an instance exists in ZooKeeper. This affects three components:
accumulo-manager-deployment.yaml)docker-entrypoint.sh)validate-accumulo-init.sh)The current check uses a simple grep pattern to detect if an instance exists:
However,
ListInstancesoutputs the ZooKeeper hostname in an INFO line:The grep pattern matches both:
accumulo-zookeeperin the INFO line (false positive)accumuloin the tableThis causes the script to incorrectly think an instance exists whenever the ZooKeeper hostname contains the instance name, even when no instance is registered in ZooKeeper.
Issue 2: Alluxio Worker Initialization Failures
The Alluxio worker was failing to start with permission errors:
/opt/alluxio/conf/alluxio-site.properties: Permission denied- attempting to write to read-only ConfigMap-mounted file/opt/alluxio/conf/alluxio-site.properties: Read-only file system- attempting to modify read-only filesystemmount: only root can use "--options" option- attempting to manually mount tmpfsThis prevented the worker from advertising its FQDN hostname correctly, making it inaccessible for init operations.
Solution
Fix 1: Instance Detection
Changed the grep pattern to match the instance name with surrounding quotes:
grep -q "\"$INSTANCE_NAME\""Since
ListInstancesalways outputs instance names in quotes (e.g.,"accumulo"), but the ZooKeeper hostname is never quoted, this ensures we only match the actual instance name column.Fix 2: Alluxio Worker Configuration
/opt/alluxio/conf/alluxio-site.propertieswhich is mounted from ConfigMapALLUXIO_WORKER_HOSTNAMEandALLUXIO_JOB_WORKER_HOSTNAMEenvironment variables with proper FQDN using Kubernetes downward API/opt/ramdiskdirectory is already mounted as emptyDir with medium: Memoryprivileged: false(no longer needed without manual mounts)Impact
Before:
After:
Testing
Fixes #22
Original prompt
Fixes #22
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.