Skip to content

vinyl: provide long run stress-like testing #5076

@Korablev77

Description

@Korablev77

In #4821 we found that Tarantool may crash or get stuck if failed dump accompanies with concurrent DDL operation. However, it is only one case where dump failure alongside with concurrent operation may lead to bug. Thus, we should provide test scenarios covering combination of dump/compact fails and meanwhile index/space drop/alter/creation procedure. For instance, it might be implemented as follows:

function generate_insert(space)
    -- assume that keys are always unsigned
    local key = random(0, MAX_KEY)
    -- depending on space's format generate corresponding payload
    local data = generate_data(space)
    space:insert({key, data})
end;

INSERT_OP = 0
DELETE_OP = 1
REPLACE_OP = 2
UPSERT_OP = 3
UPDATE_OP = 4
NO_OP = 5

function generate_op(space)
    -- assume no-ops are half of operations
    local op = random(0, NO_OP * 2)
    if op == INSERT_OP then
        generate_insert()
    end;
end;

function generate_ddl(space)
    -- index create/drop, alter etc
end;

function generate_tx()
    if box.is_in_txn() then
        -- commit, rollback or no-op
    else
        box.begin()
    end;
end;

function generate_read()
    -- read random key or start range iteraton
end;

function generate_failure()
    inj = {...}
    -- set one of available injections
end;

-- test takes 10 minutes
test_timer = 10 * 60

function main()
    -- set of spaces with random or predifined attributes:
    -- formats, vinyl options etc.
    spaces = {...}
    init_spaces(spaces)
    local start = os.clock()
    while os.clock() - start < test_timer do
        local space = get_radom_space(spaces)
        -- generate event, operation etc. Note that ratio
        -- between them matters: events should be generated
        -- relatively rarely, meanwhile operations and reads
        -- more frequently.
    end;
end;

In general case it turns out to be fuzzing problem. On the other hand, set of possible events and operations can be reduced so that test follows certain scenario (like leave only insert operations and index drop events; without transactions, reads etc).
Note that now there's (obviously) no infrastructure to launch such stress tests as a part of suite.
Also see #4251

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new functionalityqaIssues related to tests or testing subsystemvinyl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions