scylladb / scylla-cluster-tests

Tests for Scylla Clusters
GNU Affero General Public License v3.0
55 stars 93 forks source link

Support Alternator setting of tablets-enabled #8197

Closed yarongilor closed 8 hours ago

yarongilor commented 1 month ago

Tablets is currently defaulted to be disabled in Alternator. This is due to the limitation of missing LWT support for it. Yet a non-LWT Alternator configuration is supported and could be tested. It will require adding a new tag when creating a table in Alternator. For example: Tags=[{'Key': 'experimental:initial_tablets', 'Value': '4'}]

SCT currently run a "non-LWT" Alternator Longevity, where tablets are enabled but Alternator tables created disabled. A related Alternator comment for it is:

// Even if the "tablets" experimental feature is available, we currently
    // do not enable tablets by default on Alternator tables because LWT is
    // not yet fully supported with tablets.
    // The user can override the choice of whether or not to use tablets at
    // table-creation time by supplying the following tag with a numeric value
    // (setting the value to 0 means enabling tablets with automatic selection
    // of the best number of tablets).
    // Setting this tag to any non-numeric value (e.g., an empty string or the
    // word "none") will ask to disable tablets.
    // If we make this tag a permanent feature, it will get a "system:" prefix -
    // until then we give it the "experimental:" prefix to not commit to it.
    static constexpr auto INITIAL_TABLETS_TAG_KEY = "experimental:initial_tablet

A usage sample for test/alternator is:

with new_test_table(dynamodb,
        Tags=[{'Key': 'experimental:initial_tablets', 'Value': '4'}],
        KeySchema=[ { 'AttributeName': 'p', 'KeyType': 'HASH' }, ],
        AttributeDefinitions=[ { 'AttributeName': 'p', 'AttributeType': 'S' } ]) as table:
        with pytest.raises(ClientError, match='ValidationException.*tablets'):
            table.meta.client.update_time_to_live(TableName=[table.name](http://table.name/),
                TimeToLiveSpecification={'AttributeName': 'expiration', 'Enabled

(this support could be similarly applied for Dtest as well)

roydahan commented 1 month ago

I don't understand this issue.

yarongilor commented 1 month ago

@roydahan , SCT currently creates all Alternator tables with tablets-disabled. But we do want to test Alternator tablets-enabled with the job of non-LWT Alternator. this is SCT code of creating an Alternator table:

        table = dynamodb_api.resource.create_table(
            TableName=table_name, BillingMode="PAY_PER_REQUEST", **schema, **kwargs)

It cannot create a table for a keyspace with tablets-enabled unless we add an additional Tag parameter like:

        table = dynamodb_api.resource.create_table(
            TableName=table_name, BillingMode="PAY_PER_REQUEST", Tags=[{'Key': 'experimental:initial_tablets', 'Value': '4'}], **schema, **kwargs)
nyh commented 1 month ago

For example: Tags=[{'Key': 'experimental:initial_tablets', 'Value': '4'}]

Unless you really want 4 tablets specifically, I recommend using the value '0' to get the default number of tablets. The value 0 doesn't mean tablets are disabled - to disable tablets you need to use a non-numeric value (e.g., empty string or 'none' or whatever).