Proto commits in pg-sharding/spqr

These 93 commits are when the Protocol Buffers files have changed:

Commit:f3296f0
Author:denchick
Committer:GitHub

AUTO INCREMENT START syntax (#1169) Add syntax for spqr sequences start

The documentation is generated from this commit.

Commit:c2a24a9
Author:denchick
Committer:denchick

initial

The documentation is generated from this commit.

Commit:6558876
Author:denchick
Committer:GitHub

Syntax for SYNC REFERENCE TABLES (#1176) * syntax for sync * add protos

Commit:11cd56a
Author:denchick

add protos

Commit:732e79a
Author:denchick

initial

Commit:96668de
Author:Yury Frolov
Committer:GitHub

Add RETRY MOVE TASK GROUP command (#1149) * Add methods top EntityMgr & qdbCoordinator * Add RETRY MOVE TASK GROUP to gram * Add processing of retryMoveTaskGroup to meta * Add proto rpc for retryoveTaskGroup * FIx displaying of MoveTaskGroup in PsqlInteractor * Fix spell checker * Fix working with empty move task group * Fix feature test * Fix build

Commit:bcbf9fc
Author:Yury Frolov
Committer:Yury Frolov

Add proto rpc for retryoveTaskGroup

Commit:097e538
Author:Yury Frolov

Add proto rpc for retryoveTaskGroup

Commit:ed9791e
Author:Yury Frolov
Committer:GitHub

Add schema storing metadata to distributed relations (#1125) Add schema field to qdb distributed relation; Add schema name to ATTACH RELATION statement Tested with regression tests. balancer.feature checks also advanced. Usage of schema for routing in upcoming commits

Commit:355bd4c
Author:Yury Frolov
Committer:Yury Frolov

Implement many shit

Commit:aea0149
Author:Yury Frolov
Committer:Yury Frolov

Add schema name to all structs

Commit:a899e01
Author:Kirill
Committer:GitHub

Sequences (#1111) Added sequence objects. Columns can be attached to sequence and then will be injected into INSERT queries as nextval --------- Co-authored-by: denchick <denchick@yandex-team.ru>

Commit:d45db7d
Author:diphantxm

drop sequence

Commit:b8af516
Author:diphantxm

Implement ListSequences and rename ListAllSequences to ListSequences

Commit:2df42d4
Author:diphantxm
Committer:diphantxm

reset

Commit:66836d0
Author:diphantxm
Committer:diphantxm

add sequences field to models and parser

Commit:d8d8541
Author:diphantxm
Committer:diphantxm

generate next val in etcd

Commit:3c053c4
Author:diphantxm
Committer:diphantxm

make sequence an attachable object

Commit:c38c80c
Author:Yury Frolov
Committer:GitHub

Change REDISTRIBUTE KEY RANGE semantics (#1087)

Commit:0616d0e
Author:Yury Frolov

Add Apply field to proto

Commit:63eff01
Author:Yury Frolov
Committer:GitHub

Add REDISTRIBUTE CHECK command (#1075)

Commit:f5d18cd
Author:Yury Frolov
Committer:Yury Frolov

Add Check to protospecks

Commit:9a3ea81
Author:Yury Frolov
Committer:GitHub

Add spell checker to workflows (#1036) * Add spell checker to workflows * Exclude some files * Add extra dictionaries * can not -> cannot * Remove apt-key from tests.yaml * Remove apt-key elsewhere * non-existent -> nonexistent * Fix Dockerfile * Add more dictionaries * Fix typos & add expect * Fix spelling * Fix build * More spelling fixes * More fixes * Apply proposed changes

Commit:054cb1e
Author:Yury Frolov
Committer:GitHub

Add 'REDISTRIBUTE KEY RANGE' command (#789) Co-authored-by: Denis Volkov <3149929+Denchick@users.noreply.github.com>

Commit:026d31c
Author:Yury Frolov
Committer:GitHub

Refactor protospecs (#790) * Refactor protospecs * Fix feature tests

Commit:62c9895
Author:reshke
Committer:GitHub

Reference table initial infra code change (#769) * Reference table initial infra code change * Add test

Commit:86af555
Author:reshke
Committer:GitHub

Change yacc and protos for multidim key ranges. (#545) * Change yacc and protos for multidim key ranges.

Commit:f8582ea
Author:Yury Frolov
Committer:GitHub

Deprecated use of sharding rule proto & service (#518)

Commit:efc1a5d
Author:reshke
Committer:GitHub

refac (#591)

Commit:35bca1b
Author:Yury Frolov
Committer:GitHub

Add GetKeyRange method to proto & EntityMgr (#567) * Add GetKeyRange to proto * Add GetKeyRange to KeyRangeMgr * Added GetKeyRange method to all of KeyRangeMgr's * Changed id -> ids in GetKeyRange * Implement GetKeyRange in KeyRangeServiceServer's

Commit:be78c32
Author:Yury Frolov
Committer:GitHub

Added new spqr-balancer (#552) * Add new balancer * Add Balancer config * Added threshold values to balancer config * WIP * Changed metrics * WIP * WIP * General logic of generateTasks done * More additions * Refactoring * Refactoring + getShardCurrentState * Implement getHostStatus * Update key Ranges info * Implement getKeyRange * Refactoring * WIP on getStatsByKeyRange * Implemented getStatsByKeyRange * Implemented getTasks * Added TaskGroup type * Initial impl of executeTasks * Small refactoring * unificationType -> joinType * Added TasksService to proto-specs * Added TasksService to proto servers * Added internal tasks-related types, implemented Task proto services * Added Task-related methods to QDB * Declared Task-related methods to QDBs * Add Tasks to-from Db methods * Implemented TaskMgr methods * Implemented Task methods in MemQDB * Implemented Task methods in EtcdQDB * Implemented QDB-related methods in balancer * Re-written balancer to use internal Task types * Account for joinType in executeTasks * Add spqr-balancer app * Fixies * Fixed QDBs GetTaskGroup * Some logging alterations * Small interface check * Some renaming & refactoring * More shit * Fixed getting pg_is_in_recovery * Create pg_comment_stats extension on shards * Fix getHostStatus & add logging * Fixes * More small fixes * Fixes transferring from last key range * Fixed transfers of JoinNone type * Small fixes * Add balancer Makefile targets * Fix shard image's setup * Add balancer feature test * Fix working with mixed-case table names * fix boundaries in provider * Added more tests for balancer * Fixed bound selection in balancer * Added CPU test to balancer * Reduced balancer config * Added timeout to balancer config * Changed timeout in balancer configs for feature tests * Lint fix * Fix getting detailed cpu stats * Refactoring in NewBalancer * Ignore unreachable hosts rather then fail * Refactor MaxRelative & getCriterion funcs * Optimized getStatsByKeyRange by adding another index * Fix comment * Simpler-to-read formulas * Fixed fitsOnShard logic * Changed getShardToMoveTo signature to return bool instead of error * Oh no, my cum count... * Fix fitsOnShard logic * Simplify getAdjacentShards * Removed incorrect condition * use TaskGroup.Tasks as stack * Remove redundant comment * Fix moving to non-adjacent shard & more sophisticated test * Fix spqr-balancer description * Add TODO * Fixed balancer test's name * Fixed balancer feature test

Commit:c6a23f5
Author:Yury Frolov
Committer:GitHub

Drop key range upper bound from everywhere (#553) * Drop upper bound from gram * Fixed regress & feature tests * Drop UpperBound from internal & Proto * Fixed tests

Commit:dc4ebda
Author:Yury Frolov
Committer:GitHub

Change key range splitting/unification logic (#549) * Changed proto-specs * Change key range logic from left-right to base-appendage * Add SplitRight field to kr.SplitKeyRange * SplitRight -> SplitLeft * Process SplitLeft in KeyRangeMgr's * Fixed Unite in qdbCoordinator * Fixed feature tests

Commit:5fcc990
Author:Yury Frolov
Committer:GitHub

Remove balancer (#547)

Commit:19a0a0c
Author:Yury Frolov
Committer:GitHub

Deprecate key range upper bound in grpc (#527) * Deprecate key range upper bound in protos * Fix lint in coordinator.go

Commit:8c638b0
Author:Yury Frolov
Committer:GitHub

Fix spqrdump & add feature tests (#526) * Fix & refactor spqrdump * Added tests & fixed spqrql * Added tests & fixed spqrql * Add ListAllKeyRanges to grpc * Add ListAllKeyRanges to KeyRangeServiceServer's * Process empty hash correctly in spqrql * Fixed DistributionFromProto * Add feature test for dumper & small fixes * Fix lint * Added health checks for routers in feature tests * Fixed ListAllKeyRanges in Adapter * spqr-dumper -> spqrdump * dumper -> spqrdump

Commit:422e252
Author:reshke
Committer:reshke

Multidimentional routing basics tmp Multidimentional routing basics

Commit:5df3e64
Author:reshke
Committer:GitHub

Simplify & refactor insert on target list + insert on values scan rou… (#504) * Simplify & refactor insert on target list + insert on values scan routing * fix * fix * drop ununed code * fix lint

Commit:cbc1af6
Author:reshke
Committer:GitHub

Support hash functions in distributions. Add distribution key in inte… (#503) * Support hash functions in distributions. Add distribution key in interfaces * fix * Apply suggestions from code review Co-authored-by: Yury Frolov <57130330+EinKrebs@users.noreply.github.com> * Small fix --------- Co-authored-by: Yury Frolov <57130330+EinKrebs@users.noreply.github.com> Co-authored-by: Yury Frolov <yura200253@gmail.com>

Commit:56c69ca
Author:Yury Frolov
Committer:GitHub

Forbid default distribution & coordinator fixes (#490) * Changed GetRelationDistribution in MemQDB * Changed unit tests for memQDB * Restored a unit test for memQDB * Changed regression tests execution * Fix router/begin regression test * Require distribution in sharding rule/key range definition * FIXUP_INTO begin test fix * FIXUP_INTO begin test fix * Fixed copy_routing regress test * FIXUP_INTO regression test exec * Fixed router/error regression test * Fixed router/joins regression test * Fixed router/mixed_routing regression test * Fixed router/multishard regression test * Changed & disabled router/routing_hint regression test * Removed absent test from schedule * Fixed router/shard_routing regression test * Fixed router/single_shard_joins regression test * Fixed router/target_session_attrs regression test * Fixed router/transactions regression test * Fixed router/with_tables regression test * Fixed coordinator test execution * Fixed console regression tests * ListDistribution -> ListDistributions * Implemented missing methods in coordinator.go * FIXUP_INTO etcdqdb changes * Added DistributionId to sharding rule proto * Fixed CreateDistribution in coordinator * Fix key range union in qdbCoordinator * Fixed default docker-compose.yaml * Fixed Split/Unite methods in QdbCoordinator * Fixed coordinator feature test * Fixed init.sql in feature tests * FIXUP_INTO some coordinator-related shit * More obvious "*-admin host setup in feature tests" * Fix move feature test * Fix move_recover feature test * Fix other feature tests * Fixed linter * Fixed unit tests * Fixed console regression tests expected output * more refactoring in Makefile * Removed setting default distribution in meta.ProcessDrop * Fixed stress test * Fixes for proto tests

Commit:eb8bb6a
Author:Yury Frolov
Committer:GitHub

Added 'ALTER DISTRIBUTION ds_id DETACH RELATION rel_id' statement support (#484) * Add DetachRelation to ast.go * Add DetachRelation support to gram * Added AlterDistributionDetach method to QDB * Implemented AlterDistributionDetach method in MemQDB * Implemented AlterDistributionDetach method in EtcdQDB * Forbid re-attaching relation in EtcdQDB * Forbid re-attaching relation in MemQDB * Added AlterDistributionDetach to DistributionMgr * Added AlterDistributionDetach to PsqlInteractor * Added DetachRelation processing to meta.go * Fix & expanded regression tests * Added AlterDistributionDetach method to DistributionService * Generate artifacts * Implemented other EntityMgr's * Added unit tests to MemQDB * Fixed tests * Fixed lint * Changed AlterDistributionDetach GRPC method's signature * Fix regress tests * Expanded alter distribution regression tests * Check idempotency of relation detaching in unit tests

Commit:20e52fc
Author:reshke
Committer:GitHub

Rename dataspace to distribution and refactor relating code (#455) * Add rename dataspace to distribution and refactor related code --------- Co-authored-by: Denis Volkov <3149929+Denchick@users.noreply.github.com>

Commit:044e21a
Author:CBists
Committer:GitHub

Implement GetCoordinator in adapter (#440) * Implement GetCoordinator in adapter * Implement updateCoord * delete todo

Commit:cb722e1
Author:Yury Frolov
Committer:GitHub

Attach table to dataspace (#389) * Added AttachToDataspace & GetDataspace methods to qdb interface * Added AttachToDataspace & GetDataspace methods to etcd QDB * Added AttachToDataspace & GetDataspace methods to mem QDB * Added getAntRelation method to ProxyRouter * Get dataspaces in routeWithRules * Altered proto specs * Fix DummySessionParamsHandler * Fix unittests * Added AttachStatement to grammatics * Added AttachTable processing to meta.go * Added test for attach statement * Added regress test for table attaching * Fixed routeWithRules * Fixed DataspaceIsDefault * Fixes proxy_routing.go * Fixed unittests * Changed table namespace in qdb

Commit:8bb3e5e
Author:reshke
Committer:GitHub

Better (#365) * Better * Fix * Better * Fix * Better

Commit:af71cf5
Author:CBists
Committer:GitHub

Dataspace v3 (#322) * Rebase of some work * Add Delete Dataspace Support * fix * gen * correction * Add validation to add kr and shr * Correction * Fix lint test * refactor set command * refactor set command * Fix * fix regress * fir feature * fix feature * fix feature * fix feature * fix feature * fix feature * fix feature * fix feature * fix feature * change proto * gen * fix feature * fix feature * fix feature * fix feature * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * feature fix * feature fix * feature fix * change HARD flag * gen * fix regress * fix feture * to gen * gen * refactor * refactor * Add new test to delete dataspace * To gen * gen * implement dataspace methonds in adapter.go * refactor set command * Change error message * fix regress * fix tests --------- Co-authored-by: root <root@spqr-test.ru-central1.internal>

Commit:3439a72
Author:Kirill
Committer:GitHub

Run coordinator together with router (#287) Dispatch coordinator goroutines with router binary start. Proxy all modifying requests to Coordinator via grpc. Run admin console in proxy way for several type of queries: All modify requests to router console should be proxied to coordinator via particular gRPC-call. It is very dangerous to allow user to modify router metadata, like key-ranges or sharding rules, etc. This only should by done by coordinator or via coord. API. All show requests, like SHOW CLIENTS etc should be processed locally. In future, we can support installation-wide show requests processing using additional syntax, like SHOW CLIENTS is processed by router but SHOW GLOBAL CLIENTS to be proccesed by coordinator (coord. can process such queries already).

Commit:c0de31c
Author:Filippov Stepan
Committer:GitHub

Coordinator Show clients/pools/backend_connections funcs (#265) * implement pools for coordinator * `show pools` & `show backend connections ` now shows router names * added units for coord pool * added feature for show pools etc.

Commit:870f6af
Author:reshke
Committer:GitHub

Show backend connections and minor refactor (#246) * Show backend connections and minor refactor * Implement router grpc handlers

Commit:36f6a9e
Author:nikifkon
Committer:GitHub

Show clients on coordinator as well (#243) * show clients on coordinator as well * refactor

Commit:e15a771
Author:reshke
Committer:GitHub

Support add and list shards cmds in coordctl (#130) Example: reshke@oheijweoij:~/spqr$ ./coorctl AddShard --shard-id 10 --shard-hosts 'localhost:1234' ------------------------------------- create shard with id: 10 and hosts: [localhost:1234] ------------------------------------- reshke@oheijweoij:~/spqr$ ./coorctl ListShards ------------------------------------- 1 shards found router 10 serving on host group [localhost:1234] -------------------------------------

Commit:cb33e83
Author:reshke
Committer:GitHub

Refactor coordinator grpc services. Rename RoutersService to Topolog… (#129) * Refactor coordinator grpc services. Rename RoutersService to TopologyService Also, move generated proto specs out of router to pkg, as this code is sharable accross codebase Simple grpcurl call example reshke@oheijweoij:~$ ./grpcurl -plaintext 'localhost:7003' spqr.RouterService/ListRouters { "routers": [ { "id": "r1", "adress": "localhost:1234" } ] } now can be also done with ctl util reshke@oheijweoij:~/spqr$ ./coorctl AddRouter -e localhost:7003 --router-endpoint localhost:1234 ------------------------------------- create router with id: 19762ac60a45 ------------------------------------- reshke@oheijweoij:~/spqr$ ./coorctl ListRouters ------------------------------------- 1 routers found router 19762ac60a45 serving on address localhost:1234 ------------------------------------- reshke@oheijweoij:~/spqr$

Commit:8ae8bb1
Author:reshke
Committer:GitHub

Add infrasture code and changes to support Hash-based routing (#105) * Add infrasture code and changes to support Hash-based routing Change grpc, sql-console and internal interfaces of sharding rule. * Change create sharding rule syntax to be backward-compatable * Fix sharding rule data model, move table name outside of sharding rule entry Fix regress tests to match new output msg * Fix tests

Commit:5e98a2e
Author:reshke

Drop unused Query Service protos, since coordinator-router interaction using grpc services, not sql

Commit:825f6fb
Author:kirill reshke
Committer:GitHub

Refactor proxy router code, implement missing methods (#60) Do not open router to clients before initialized metadata with coordinator. Add router option, that prevents router from executing client queries before metadata was properly synced with coordinator. Do not change router behavior with no-coordinator setup

Commit:155c7f1
Author:kirill reshke
Committer:GitHub

Add resolve key range protos (#59)

Commit:d54e5a3
Author:kirill reshke
Committer:GitHub

Add missing coordinator and router functionality (#52)

Commit:abdeeae
Author:kirill reshke
Committer:GitHub

Add drop sharding rules statement support, regenerate protos (#51) * Add drop sharding rules statement support, regenerate protos accordingly * Drop tests table before tests, to cleanup from prev runs

Commit:d6ed22e
Author:kirill reshke
Committer:GitHub

Add sharding rules support in coordinator (#48) Add sharding rules support in coordinator, refactor code and regenerate proto.

Commit:2e97ffb
Author:Artyom Kartasov
Committer:GitHub

Balancer console (#33) * init console interface for Balancer App * support commands: * show key ranges * split key range * use spqrlog package to log messages

Commit:aa9e5b1
Author:kirill reshke
Committer:GitHub

regenerate proto (#32) * regenerate proto * Implement more basic coordinator - router interaction requests * add test * fix test

Commit:4059ca1
Author:Artyom Kartasov
Committer:GitHub

Balancer App (#20) * balancer-db,-installation interaction * balancer-coordinator interaction * fix of moveKeyRange call in balancer * balancer app * fix(router): proxy queries that do not match any shard to the world storage * fix: update proto files and open ports to run coordinator * fix DDL operations * skip world queries * feat(coordinator): unregister routers * fix: implement the ShardingRules service * feat(coordinator): configure a new qrouter using coordinator * feat(coordinator): store ShardingRules and apply the existing rules to the router after registration * feat(balancer): implement shard service * feat(balancer): run balancer, register shards, init the DB, dockerize balancer * fix: list key ranges to use in balancer * fix: balancer db connections and queries to manage actions * fix: locking key ranges * feat: detect key ranges to lock, preparing a shard FDW * feat: transfer data, move key range, delete old key range * feat: unite key ranges * fix: add sharding key to the config, rewrite installation queries by removing hardcoded table values * fix data duplication on move table, make possible the parallel task running * fix: panic on assignment to entry in nil map, remove debug lines * adjust configs * fix config to pass tests * Merge master into shard-service Co-authored-by: Sviatoslav Ermilin <ermilin.c@yandex.ru>

Commit:ffb2fdf
Author:Sviatoslav Ermilin
Committer:reshke

better protos

Commit:70611bc
Author:Sviatoslav Ermilin
Committer:reshke

add some balancer code

Commit:aa8f0c5
Author:reshke
Committer:reshke

refactoring

Commit:18d0270
Author:Sviatoslav Ermilin

better protos

Commit:a0ea898
Author:Sviatoslav Ermilin

add some balancer code

Commit:bd6b0a7
Author:reshke
Committer:reshke

Split key range request in coordinator

Commit:e5c7754
Author:reshke
Committer:reshke

refactor key range & sharding rules services

Commit:3ee9528
Author:reshke
Committer:reshke

refactor grpc iface

Commit:c73bcf4
Author:reshke

apply fmt

Commit:cbc8cb1
Author:reshke

Implement a couple of router grpc iface methods

Commit:c9564ca
Author:reshke
Committer:reshke

Router grpc iface

Commit:2fe0a7a
Author:reshke
Committer:reshke

regenerate proto proretly

Commit:32ed6e3
Author:reshke

gen protos for coordinator

Commit:db3539b
Author:reshke

stress tests fixes

Commit:f5ce394
Author:reshke

fix tests & update proto

Commit:5297535
Author:reshke

fix protos

Commit:2d17204
Author:reshke

update protos

Commit:b381c31
Author:reshke

coordinator basics

Commit:718febd
Author:reshke

refactor

Commit:157813e
Author:reshke
Committer:reshke

Change routing to match byte ranges

Commit:ad7bbcb
Author:reshke
Committer:reshke

Better

Commit:e1eb2b8
Author:reshke

proto for coordinator

Commit:76e88ff
Author:reshke

Move qdb code 2 coordinator

Commit:7ac3e77
Author:reshke

Regenerate protos

Commit:00bb662
Author:reshke
Committer:reshke

refactor protos + load mirroring basics

Commit:fb2c42b
Author:reshke
Committer:reshke

Key range api basics

Commit:4079df3
Author:reshke
Committer:reshke

Fix protos

Commit:2a6d5e9
Author:denchick

mv genproto/protos protos/

Commit:9948139
Author:reshke

refactor

Commit:ee653c4
Author:reshke

proto

Commit:ca757e3
Author:reshke
Committer:reshke

some code Some ssl fixes protos protos protos