Giter Site home page Giter Site logo

futurewei-cloud / chogori-sql Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 6.0 45.65 MB

Horizontally scalable SQL Service built upon Chogori-Platform SKV storage

License: Other

Emacs Lisp 0.01% CMake 0.01% Makefile 0.76% M4 0.25% Shell 0.18% C 84.41% PLpgSQL 6.72% Perl 2.04% C++ 2.69% Yacc 1.47% Lex 0.47% Ruby 0.56% Python 0.18% XSLT 0.14% CSS 0.01% Assembly 0.01% Roff 0.07% sed 0.01% DTrace 0.01% XS 0.02%

chogori-sql's People

Contributors

ivan-avramov avatar jerryhfeng avatar jfunston avatar johnfangafw avatar raduvine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chogori-sql's Issues

Remove tablet related YBC PG gate apis

YBC PG gate APIs consist of YBC's feature that we don't need, for example,

YBCStatus YBCPgCreateTableSetNumTablets(YBCPgStatement handle, int32_t num_tablets);

YBCStatus YBCPgCreateTableAddSplitRow(YBCPgStatement handle, int num_cols,
YBCPgTypeEntity **types, uint64_t *data);

YBCStatus YBCPgCreateIndexSetNumTablets(YBCPgStatement handle, int32_t num_tablets);

YBCStatus YBCPgCreateIndexAddSplitRow(YBCPgStatement handle, int num_cols,
YBCPgTypeEntity **types, uint64_t *data);

We need to remove them from the PG Gate APIs and PG code.

Add retry logic to handle errors

Need to have a generic retry logic/framework to decide whether we should retry an operation or transaction and what would be retry policy.

support database level catalog version

Right now, the catalog version is at cluster level and it is used for an indication of cache refresh. To have fine-grained control of the catalog version, ideally, we should have catalog version at the database level. However, this requires to change ybc logic inside PG. Also pay attention to shared table update such as pg_database.

TPCC-SQL client

We have to choose a TPCC-SQL driver to use and benchmark our SQL milestone

PGGate API get() on future into k23si should have a reasonable timeout.

Otherwise, it will hang forever. This could happen when it failed to contact Chogori/SKV layer.

e.g. in following code
std::shared_ptr SqlCatalogManager::NewTransactionContext() {
std::future txn_future = k2_adapter_->beginTransaction();
std::shared_ptr txn = std::make_shared(txn_future.get()); // hang when K2_adapter can't return a transaction asynchronously.

Add secondary Index support

Store secondary index as another schema, but need to insert the index data in SKV since SKV does not have a secondary index concept.

Might not be needed for Milestone M0.1.

Add logic to maintain cluster level logic

Need to maintain cluster level logic, for example, if the cluster has already been bootstrapped or not. The catalog version that used to indicate that a catalog version has been updated.

Bind PgExpr to SKV expression

Right now, we bind PgExpr to intermediate expression data structure in pg_op_api.h. We should refactor this to bind PgExpr directly to the SKV expression to avoid additional conversion when we call SKV clients.

Clean up YB_ Data types in PG and PG gate

Need to clean up the YB_ data types:

typedef enum PgDataType {
YB_YQL_DATA_TYPE_NOT_SUPPORTED = -1,
YB_YQL_DATA_TYPE_UNKNOWN_DATA = 999,
YB_YQL_DATA_TYPE_NULL_VALUE_TYPE = 0,
YB_YQL_DATA_TYPE_INT8 = 1,
YB_YQL_DATA_TYPE_INT16 = 2,
YB_YQL_DATA_TYPE_INT32 = 3,
YB_YQL_DATA_TYPE_INT64 = 4,
YB_YQL_DATA_TYPE_STRING = 5,
YB_YQL_DATA_TYPE_BOOL = 6,
YB_YQL_DATA_TYPE_FLOAT = 7,
YB_YQL_DATA_TYPE_DOUBLE = 8,
YB_YQL_DATA_TYPE_BINARY = 9,
YB_YQL_DATA_TYPE_TIMESTAMP = 10,
YB_YQL_DATA_TYPE_DECIMAL = 11,
YB_YQL_DATA_TYPE_VARINT = 12,
YB_YQL_DATA_TYPE_INET = 13,
YB_YQL_DATA_TYPE_LIST = 14,
YB_YQL_DATA_TYPE_MAP = 15,
YB_YQL_DATA_TYPE_SET = 16,
YB_YQL_DATA_TYPE_UUID = 17,
YB_YQL_DATA_TYPE_TIMEUUID = 18,
YB_YQL_DATA_TYPE_TUPLE = 19,
YB_YQL_DATA_TYPE_TYPEARGS = 20,
YB_YQL_DATA_TYPE_USER_DEFINED_TYPE = 21,
YB_YQL_DATA_TYPE_FROZEN = 22,
YB_YQL_DATA_TYPE_DATE = 23,
YB_YQL_DATA_TYPE_TIME = 24,
YB_YQL_DATA_TYPE_JSONB = 25,
YB_YQL_DATA_TYPE_UINT8 = 100,
YB_YQL_DATA_TYPE_UINT16 = 101,
YB_YQL_DATA_TYPE_UINT32 = 102,
YB_YQL_DATA_TYPE_UINT64 = 103
} YBCPgDataType;

Support row identifier (ycbtid) in k2 adapter and k2 SKV

ycbtid is a unique row identifier string heavily used in the layers above k2 adapter. We need to support vending out the identifier given a row, and using the identifier to issue read and write requests. This may require adding support to the SKV client API.

Use future based APIs for Catalog Manager

We like to have a consistent APIs. Right now, some are using future based APIs. We might want to convert Catalog manager to use future based APIs later. However, to do that, we need to think of how to support future based APIs on server side since eventually, catalog manager will be a remote server.

Cache k2 schemas in k2 adapter

Getting k2 schemas requires a request to seastar over the shared queue which could be expensive. Schemas are immutable so they can easily be cached by the k2 adapter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.