mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 12:36:56 +00:00
Currently, if a user tries to CreateTable with a forbidden set of tags, e.g., the Tags list is too long or contains an invalid value for system:write_isolation, then the CreateTable request fails but the table is still created. Without the tag of course. This patch fixes this bug, and adds two test cases for it that fail before this patch, and succeed with it. One of the test cases is scylla_only because it checks the Scylla-specific system:write_isolation tag, but the second test case works on DynamoDB as well. What this patch does is to split the update_tags() function into two parts - the first part just parses the Tags, validates them, and builds a map. Only the second part actually writes the tags to the schema. CreateTable now does the first part early, before creating the table, so failure in parsing or validating the Tags will not leave a created table behind. Fixes #6809. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20200713120611.767736-1-nyh@scylladb.com>