Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
version-check:
# We need this job to run only on push with tag.
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check module version
uses: tarantool/actions/check-module-version@master
Expand All @@ -18,9 +18,9 @@ jobs:

publish-scm-1:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
Expand All @@ -29,13 +29,13 @@ jobs:
publish-tag:
if: startsWith(github.ref, 'refs/tags/')
needs: version-check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- uses: tarantool/setup-tarantool@v1
- uses: tarantool/setup-tarantool@v4
with:
tarantool-version: '2.8'
tarantool-version: '2.11'

- run: cmake .
- run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ on: [push]

jobs:
all:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
DOWNLOAD_TOKEN: ${{ secrets.DOWNLOAD_TOKEN }}
ROCKS_USERNAME: ${{ secrets.ROCKS_USERNAME }}
ROCKS_PASSWORD: ${{ secrets.ROCKS_PASSWORD }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: tarantool/setup-tarantool@v1
uses: actions/checkout@v6
- uses: tarantool/setup-tarantool@v4
with:
tarantool-version: '2.8'
tarantool-version: '2.11'

- name: CMAKE
run: cmake .
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10...3.31 FATAL_ERROR)

project(graphqlapi NONE)

Expand Down
31 changes: 12 additions & 19 deletions examples/cartridge-simple/app/test_data.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
local ddl
local ok, rc = pcall(require, 'ddl-ee')
if ok then
ddl = rc
else
ddl = require('ddl')
end

local ddl = require('ddl')
local log = require('log')

local function fill()
Expand All @@ -17,33 +10,33 @@ local function fill()
is_local = false,
temporary = false,
format = {
{ name = 'customer_id', is_nullable = false, type = 'unsigned' },
{ name = 'bucket_id', is_nullable = false, type = 'unsigned' },
{ name = 'fullname', is_nullable = false, type = 'string' },
{name = 'customer_id', is_nullable = false, type = 'unsigned'},
{name = 'bucket_id', is_nullable = false, type = 'unsigned'},
{name = 'fullname', is_nullable = false, type = 'string'},
},
indexes = { {
indexes = {{
name = 'customer_id',
type = 'TREE',
unique = true,
parts = {
{ path = 'customer_id', is_nullable = false, type = 'unsigned' }
{path = 'customer_id', is_nullable = false, type = 'unsigned'}
}
}, {
name = 'bucket_id',
type = 'TREE',
unique = false,
parts = {
{ path = 'bucket_id', is_nullable = false, type = 'unsigned' }
{path = 'bucket_id', is_nullable = false, type = 'unsigned'}
}
}, {
name = 'fullname',
type = 'TREE',
unique = true,
parts = {
{ path = 'fullname', is_nullable = false, type = 'string' }
{path = 'fullname', is_nullable = false, type = 'string'}
}
} },
sharding_key = { 'customer_id' },
}},
sharding_key = {'customer_id'},
}
}
}
Expand All @@ -60,8 +53,8 @@ local function fill()

if box.space['customer'] ~= nil then
for id = 1, 250 do
local bucket_id = ddl.bucket_id('customer', { id })
crud.replace('customer', { id, bucket_id, 'Test Customer ' .. tostring(id) })
local bucket_id = ddl.bucket_id('customer', {id})
crud.replace('customer', {id, bucket_id, 'Test Customer '..tostring(id)})
end
end
end
Expand Down
19 changes: 6 additions & 13 deletions graphqlapi/cluster.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
local argparse = require('cartridge.argparse')
local cartridge = require('cartridge')
local ddl = require('ddl')
local errors = require('errors')
local membership = require('membership')
local pool = require('cartridge.pool')
local vshard = require('vshard')

local utils = require('graphqlapi.utils')

local ddl
local ok, rc = pcall(require, 'ddl-ee')
if ok then
ddl = rc
else
ddl = require('ddl')
end

local _replicas = {}

local e_cluster_api = errors.new_class('cluster API error', { capture_stack = false })
Expand All @@ -38,7 +31,7 @@ local function get_servers()
table.insert(servers, { alias = alias, conn = conn })
else
connect_errors = connect_errors or {}
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
end
end
return servers, connect_errors
Expand All @@ -54,7 +47,7 @@ local function get_masters()
table.insert(servers, { alias = alias, conn = conn })
else
connect_errors = connect_errors or {}
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
end
end
return servers, connect_errors
Expand All @@ -79,7 +72,7 @@ local function get_storages_instances(mode, prefer_replica, balance)
_replicas[uuid] = conn.peer_uuid
else
if prefer_replica == false and balance == false then
conn = replicaset.master.next_by_priority.conn
conn = replicaset.master.next_by_priority.conn
_replicas[uuid] = conn.peer_uuid
elseif prefer_replica == false and balance == true then
local prev_uuid = _replicas[uuid] or replicaset.priority_list[1].uuid
Expand Down Expand Up @@ -175,7 +168,7 @@ local function get_servers_by_list(instances)
table.insert(servers, { replicaset_uuid = replicaset_uuid, alias = alias, conn = conn, })
else
connect_errors = connect_errors or {}
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
table.insert(connect_errors, e_cluster_api:new('instance \'%s\' error: %s', alias, err))
end
end
end
Expand All @@ -186,7 +179,7 @@ local function get_existing_spaces()
local spaces = {}
local schema = ddl.get_schema()
for space in pairs(schema.spaces) do
spaces[space] = space
spaces[space]=space
end
return spaces
end
Expand Down
Loading