Closed tarzanek closed 1 day ago
TB=$(echo "$i"|awk -F'/' '{ print $NF }'|awk -F'-' '{ print $1 }')
should be moved to something like
FTB=$(echo "$i"|awk -F'/' '{ print $NF }')
TB=${FTB%-*}
or anything similar, that would just strip away LAST occurence of everything after LAST "-"
so alternator can accept table names with "-" in name, hence this can happen (cql won't allow that)
e.g. I can create such table: ubuntu@ubuntu:~$ ls /var/lib/scylla/data/alternator_my-usertable/my-usertable-b2a9512037af11efbdddb8c11b2d3d7b/
$ sudo apt install python3-boto3
$ cat create_table_alternator.py
import boto3
dynamodb = boto3.resource('dynamodb',endpoint_url='http://localhost:8000',
region_name='None', aws_access_key_id='None', aws_secret_access_key='None')
dynamodb.create_table(
AttributeDefinitions=[
{
'AttributeName': 'key',
'AttributeType': 'S'
},
],
BillingMode='PAY_PER_REQUEST',
TableName='my-usertable',
KeySchema=[
{
'AttributeName': 'key',
'KeyType': 'HASH'
},
])
$ python3 create_table_alternator.py
hmm that simple patch works
Jul 01 13:45:19 ubuntu scylla[849]: [shard 0:stre] api - force_keyspace_cleanup: keyspace=alternator_my-usertable tables={table{name=my-usertable, id=b2a95120-37af-11ef-bddd-b8c11b2d3d7b}}
https://github.com/scylladb/scylla-ansible-roles/blob/master/example-playbooks/run_cleanup/files/cleanup.sh
name of table is "my-table"