Version Management¶
This guide covers version compatibility issues and upgrade procedures for zae-limiter.
Decision Tree¶
Troubleshooting¶
Symptoms¶
VersionMismatchErrorexception raisedIncompatibleSchemaErrorexception raised- CLI commands fail with version errors
- Rate limiter initialization fails
Diagnostic Steps¶
Check compatibility with CLI:
View detailed version information:
Query version record directly:
aws dynamodb get-item --table-name <name> \
--key '{"PK": {"S": "SYSTEM#"}, "SK": {"S": "#VERSION"}}'
VersionMismatchError¶
Cause: Client library version differs from deployed Lambda version.
Example error:
VersionMismatchError: Version mismatch: client=1.2.0, schema=1.0.0, lambda=1.0.0.
Lambda update available.
Solution: Upgrade Lambda to match client:
Or programmatically:
from zae_limiter import Repository, RateLimiter
# Auto-update Lambda on initialization (default behavior)
repo = await Repository.builder().build()
limiter = RateLimiter(repository=repo)
IncompatibleSchemaError¶
Cause: Major version difference requiring schema migration.
Example error:
IncompatibleSchemaError: Incompatible schema: client 2.0.0 is not compatible
with schema 1.0.0. Migration required.
Solution: Follow the Migration Guide to upgrade the schema:
- Create a backup
- Run migration
- Update client
# Create backup before migration
aws dynamodb create-backup \
--table-name <name> \
--backup-name "pre-migration-$(date +%Y%m%d)"
Then follow the migration procedures in the Migration Guide.
Minimum Client Version Error¶
Cause: Infrastructure requires a newer client version.
Solution: Upgrade the client library:
Upgrade Procedure¶
Pre-upgrade Checklist¶
Before upgrading, verify the following:
- Check current version:
zae-limiter version --name <name> - Check compatibility:
zae-limiter check --name <name> - Review release notes for breaking changes
- Verify PITR is enabled for rollback capability
- Schedule maintenance window (if major upgrade)
- Notify stakeholders
Upgrade Execution¶
Standard upgrade (Lambda + client):
# Step 1: Upgrade client library
pip install --upgrade zae-limiter
# Step 2: Update infrastructure
zae-limiter upgrade --name <name> --region <region>
# Step 3: Verify
zae-limiter check --name <name> --region <region>
Lambda-only upgrade:
# Update Lambda without schema changes
zae-limiter upgrade --name <name> --region <region> --lambda-only
Force upgrade (skip compatibility check):
Use with caution
Only use --force when you understand the implications.
Post-upgrade Verification¶
After upgrading, verify the system is healthy:
-
Check version alignment:
-
Run smoke tests:
from zae_limiter import Repository, RateLimiter, Limit repo = await Repository.open() limiter = RateLimiter(repository=repo) # Test basic operation async with limiter.acquire( entity_id="test-entity", resource="test", limits=[Limit.per_minute("rpm", 100)], consume={"rpm": 1}, ): print("Rate limiting working") -
Monitor for 15 minutes:
- Check Lambda error rate in CloudWatch
- Verify usage snapshots are updating
- Watch for unexpected exceptions in application logs
Rollback¶
If issues occur after upgrade, see Recovery & Rollback.
Related¶
- Migration Guide - Schema versioning and migration procedures
- Recovery & Rollback - Emergency rollback procedures
- CLI Reference - Full CLI command documentation