Skip to content

vtest: fix cluster_new for replicaset with ssl replication #603

@mrForza

Description

@mrForza
  1. Environment

    Tarantool version: Tarantool Enterprise 3.6.0-entrypoint-17-g068fb6f

    Vshard version: 0.1.36

    OS: Garuda linux (x86-x64)

  2. Bug description: the vtest module is not adapted for cluster which has replicaset with ssl replication.

  3. Reproducer:

    local t = require('luatest')
    local vtest = require('test.luatest_helpers.vtest')
    local vutil = require('vshard.util')
    local fio = require('fio')
    
    local g = t.group('ssl')
    
    local cfg_template = {
        sharding = {
            {
                replicas = {
                    replica_1_a = {
                        master = true,
                    },
                    replica_1_b = {},
                },
                is_ssl = true,
            },
            {
                replicas = {
                    replica_2_a = {
                        master = true,
                    },
                    replica_2_b = {},
                },
                is_ssl = true,
            },
        },
        bucket_count = 100,
    }
    local global_cfg = vtest.config_new(cfg_template)
    
    g.before_all(function()
        t.run_only_if(vutil.feature.ssl)
        vtest.cluster_new(g, global_cfg)
        vtest.cluster_bootstrap(g, global_cfg)
        vtest.cluster_rebalancer_disable(g)
        vtest.cluster_wait_fullsync(g)
    end)
    
    g.after_all(function()
        g.cluster:drop()
    end)
    
    g.test_1 = function(g)
        require('log').info('!\tStart...')
    end
  4. Actual result (ssl_test.result):

    File: /tmp/t/001_router-luatest/ssl.result
    Tarantool version is 3.6.0-entrypoint-17-g068fb6f
    TAP version 13
    1..1
    # Started on Thu Oct 16 21:59:29 2025
    # Starting group: ssl
    replica_1_a | Incorrect value for option 'replication': Invalid URI table: expected {uri = string, params = table} or {string, params = table} {"type
    ":"ClientError","code":59,"name":"CFG","option":"replication","details":"Invalid URI table: expected {uri = string, params = table} or {string, param
    s = table}","trace":[{"file":"[C]","line":4294967295}]}
    replica_1_a | fatal error, exiting the event loop
    replica_2_a | Incorrect value for option 'replication': Invalid URI table: expected {uri = string, params = table} or {string, params = table} {"type
    ":"ClientError","code":59,"name":"CFG","option":"replication","details":"Invalid URI table: expected {uri = string, params = table} or {string, param
    s = table}","trace":[{"file":"[C]","line":4294967295}]}
    replica_2_a | fatal error, exiting the event loop
    replica_1_b | Incorrect value for option 'replication': Invalid URI table: expected {uri = string, params = table} or {string, params = table} {"type
    ":"ClientError","code":59,"name":"CFG","option":"replication","details":"Invalid URI table: expected {uri = string, params = table} or {string, param
    s = table}","trace":[{"file":"[C]","line":4294967295}]}
    replica_1_b | fatal error, exiting the event loop
    replica_2_b | Incorrect value for option 'replication': Invalid URI table: expected {uri = string, params = table} or {string, params = table} {"type
    ":"ClientError","code":59,"name":"CFG","option":"replication","details":"Invalid URI table: expected {uri = string, params = table} or {string, param
    s = table}","trace":[{"file":"[C]","line":4294967295}]}
    replica_2_b | fatal error, exiting the event loop
    
  5. Expected behavior: successfully passed test

  6. Problems:

    • uri module cannot parse uris of the type: {uri_string, params = {...}}

    • cluster_new function incorrectly sets listen option of master and replicas. It doesn't pass ssl-related data to it like ssl_cert_file, ssl_key_file, ssl_ca_file e.t.c. It causes ER_INVALID_MSGPACK error which is spammed every second.

    • If we change cluster_new in such a way that uri will be passed by uri module and listen option will consists of ssl-related data we will get SSL_Read unexpected eof while reading error. No idead what can cause the third bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstorage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions