nuvo / cain

Backup and restore tool for Cassandra on Kubernetes
Apache License 2.0
32 stars 21 forks source link

Restoring passing schema fails #6

Closed alexbarta closed 5 years ago

alexbarta commented 5 years ago

Hi Maor,

Trying to restore passing the schema argument but it seems that cain searches for an nonexisting s3 path (schema.cql/schema.cql):

 $ cain restore --src 's3://db-backup/cassandra/default/thingsboard' -n default -k keyspace1 -l app=cassandra -t 20181228214738 --schema schema.cql
2018/12/28 21:55:17 Restore started!
2018/12/28 21:55:17 Getting clients
2018/12/28 21:55:17 Getting pods
2018/12/28 21:55:17 Getting current schema
2018/12/28 21:55:18 Schema not found, restoring schema schema.cql
2018/12/28 21:55:18 [1/1] copy: s3://db-backup/cassandra/default/thingsboard/keyspace1/schema.cql/schema.cql -> k8s://default/cassandra-0/cassandra/tmp/keyspace1/schema.cql
2018/12/28 21:55:21 NoSuchKey: The specified key does not exist.
    status code: 404, request id: 15749DD7A2E251C2, host id:   src: file: db-backup/cassandra/default/thingsboard/keyspace1/schema.cql/schema.cql
2018/12/28 21:55:21 [1/1] done: s3://db-backup/cassandra/default/thingsboard/keyspace1/schema.cql/schema.cql -> k8s://default/cassandra-0/cassandra/tmp/keyspace1/schema.cql
2018/12/28 21:55:21 NoSuchKey: The specified key does not exist.
    status code: 404, request id: 15749DD7A2E251C2, host id: 
maorfr commented 5 years ago

Hi,

The --schema flag takes a schema version (shortened sum). Look under s3://db-backup/cassandra/default/thingsboard/<schemaHash>

So you would need to use --schema <schemaHash>.

alexbarta commented 5 years ago

My bad, passing the schema hash it works. You can close this one.