-
Notifications
You must be signed in to change notification settings - Fork 41
Backfill Workflow
This page describes how to perform document backfill using the Workflow CLI on Kubernetes. The workflow-based approach provides declarative configuration, automatic retry handling, and progress monitoring through Argo Workflows.
The backfill workflow migrates documents from your source cluster to your target cluster using snapshot-based reindexing (RFS). The workflow approach uses Argo Workflows to orchestrate the entire process automatically.
The backfill workflow performs these steps automatically:
- Create snapshot: Creates a snapshot of specified indexes on the source cluster
- Register snapshot: Makes the snapshot available to the target cluster
- Migrate metadata (optional): Transfers index templates and settings
- Load documents: Reindexes documents from the snapshot to the target cluster
- Cleanup: Removes temporary state and coordination data
Before running a backfill workflow:
- Have access to the migration console on your Kubernetes cluster
- Have Argo Workflows installed and running
- Ensure source and target clusters are accessible
- Have an S3 bucket or persistent volume configured for snapshots
A minimal backfill configuration includes:
sourceClusters:
my-source:
endpoint: https://source-cluster:9200
version: "7.10.2"
authConfig:
basic:
username: admin
password: password
targetClusters:
my-target:
endpoint: https://target-cluster:9200
version: "2.11.0"
authConfig:
basic:
username: admin
password: password
migrations:
- sourceCluster: my-source
targetCluster: my-target
snapshotMigrations:
- indices: ["*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: trueSpecify which indexes to migrate using patterns:
snapshotMigrations:
# All indexes
- indices: ["*"]
# Specific patterns
- indices: ["logs-*", "metrics-*"]
# Multiple specific indexes
- indices: ["users", "orders", "products"]Control whether to migrate index templates and settings:
metadataMigration:
enabled: true # Migrate templates, mappings, settings
# or
enabled: false # Skip metadata, documents onlyEnable or disable document migration:
documentBackfill:
enabled: true # Migrate documents
# or
enabled: false # Skip documents (metadata only)If using S3 for snapshots:
sourceClusters:
my-source:
endpoint: https://source-cluster:9200
version: "7.10.2"
snapshotRepo:
s3RepoPathUri: s3://my-bucket/snapshots
aws_region: us-east-1Access the migration console and create your configuration:
# Load sample and customize
workflow configure sample --load
workflow configure editSubmit the workflow to Argo:
workflow submitNote the workflow name from the output for monitoring.
Check workflow status:
workflow statusExample output:
[*] Workflow: migration-abc123
Phase: Running
Started: 2024-01-15T10:30:00Z
📋 Workflow Steps
├── ✓ Initialize (Succeeded)
├── ✓ Create Snapshot (Succeeded)
├── ✓ Register Snapshot (Succeeded)
├── ▶ Migrate Metadata (Running)
├── ○ Restore Documents (Pending)
└── ○ Cleanup (Pending)
The workflow runs asynchronously. Monitor until all steps succeed:
watch -n 10 workflow statusOr submit with the --wait flag to block until completion:
workflow submit --wait --timeout 3600Migrate different sets of indexes with different configurations:
migrations:
- sourceCluster: my-source
targetCluster: my-target
snapshotMigrations:
# Critical data: full migration
- indices: ["orders-*", "customers-*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: true
# Historical logs: documents only
- indices: ["logs-2023-*"]
metadataMigration:
enabled: false
documentBackfill:
enabled: true
# Templates only: no documents
- indices: ["templates-*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: falseMigrate from multiple sources simultaneously:
sourceClusters:
source-1:
endpoint: https://source1:9200
source-2:
endpoint: https://source2:9200
targetClusters:
target:
endpoint: https://target:9200
migrations:
- sourceCluster: source-1
targetCluster: target
snapshotMigrations:
- indices: ["source1-*"]
- sourceCluster: source-2
targetCluster: target
snapshotMigrations:
- indices: ["source2-*"]The workflow engine executes these migrations in parallel where possible.
If you have existing snapshots, configure the snapshot repository:
sourceClusters:
my-source:
endpoint: https://source:9200
snapshotRepo:
s3RepoPathUri: s3://existing-bucket/existing-snapshots
aws_region: us-west-2View all running workflows:
workflow statusView specific workflow details:
workflow statusCheck logs for a specific workflow:
workflow outputProblem: Workflow shows all steps as Pending.
Solutions:
- Check if workflow templates are deployed:
kubectl get workflowtemplates -n ma - Verify Argo Workflows is running:
kubectl get pods -n argo - Check resource availability:
kubectl describe pod -n ma
Problem: Snapshot creation step fails.
Solutions:
- Verify S3 bucket permissions
- Check source cluster has snapshot repository configured
- Ensure indexes exist and are accessible
- Review snapshot step logs for specific errors
Problem: Document restore is taking too long or appears stuck.
Solutions:
- Check target cluster health and capacity
- Monitor shard allocation:
curl http://target:9200/_cat/shards?v - Verify network connectivity between clusters
- Check if target cluster has sufficient disk space
Problem: Metadata migration fails with compatibility errors.
Solutions:
- Review breaking changes between source and target versions
- Check for unsupported field types
- See Migration Paths for version compatibility details
If you need to stop a running workflow:
workflow stopThis gracefully terminates the workflow and cleans up resources.
The workflow engine supports parallel execution of independent tasks. Configure parallelism based on your cluster capacity:
- Default: Up to 100 concurrent pods
- Limited by Kubernetes cluster resources
- Balanced against source and target cluster capacity
Workflow pods use default resource limits. For large migrations, you may need to adjust:
- CPU and memory requests/limits
- Storage for temporary data
- Network bandwidth
Factors affecting migration time:
| Factor | Impact |
|---|---|
| Total data volume | Primary factor in duration |
| Number of indexes and shards | Affects parallelism |
| Source cluster load | May throttle snapshot speed |
| Target cluster capacity | Affects indexing speed |
| Network bandwidth | Affects data transfer |
| S3 snapshot transfer speeds | Affects snapshot operations |
After the workflow completes:
workflow status# Source cluster
curl http://source:9200/_cat/indices?v
# Target cluster
curl http://target:9200/_cat/indices?v# Check target cluster indexes
curl http://target:9200/<index>/_settingsRun test queries on the target cluster to ensure data is accessible and correctly indexed.
After completing the backfill workflow:
- Verify all data migrated successfully
- Test application connectivity to the target cluster
- Review Troubleshooting if you encounter issues
- Workflow CLI Overview - Learn about the workflow approach
- Workflow CLI Getting Started - Step-by-step tutorial
- Migration Paths - Supported versions and compatibility
- Troubleshooting - Common issues and solutions
Encountering a compatibility issue or missing feature?
- Search existing issues to see if it’s already reported. If it is, feel free to upvote and comment.
- Can’t find it? Create a new issue to let us know.