Giter Club home page Giter Club logo

tateyama's People

Contributors

akirakw avatar ashigeru avatar ban-nobuhiro avatar kookubo avatar kuron99 avatar t-horikawa avatar thawk105 avatar umegane avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tateyama's Issues

oltp killで/dev/shmに残るゴミファイルの扱い

oltp killすると、tateyama-serverが作成したipc接続やサーバ状態提供用の共有メモリを消去しないまま残る。これはtateyama-serverが制御不能になり、SIGKILLを送って終了させる、という状況を想定した場合は不可避の動作である。
これらのファイルは、現在の実装では、oltp killコマンド内でtateyama-serverプロセスをkillした後に消去していたが、この方法は脆弱との指摘があったため、oltp killでは消去せず、次回のoltp startによるtateyama-serverの起動時に消去するように変更する。

デフォルト設定情報の配置を見なおす

auto default_conf_string = std::string(default_configuration);

から参照されている

static constexpr std::string_view default_configuration { // NOLINT

は、ファイル配置も名前空間も不適切なので修正する。

explicit whole(std::string_view d) {

.cpp に追い出せるので、周辺併せて configuration.cpp に definition を移動する。

https://github.com/project-tsurugi/tateyama/blob/5f0b295980609fed90862a193608ca92385b76dc/include/tateyama/detail/default_configuration.h

は、以下の修正を加える。

  • 参照元が configuration.cpp のみになっているので、 src/ 以下に移動するか、 configuration.cpp に埋め込む
  • 名前空間は tateyama::api::configuration::details

oltp start のコマンドオプションor環境変数で構成ファイルの設定項目を上書き

特にDockerでの利用時に、標準的な内容を定義した構成ファイルに対して設定を一部変更したい(特にエンドポイント系)。コンテナ上の設定ファイルを上書きするのは大変であるのと管理上も望ましくなく、ブートストラップのコマンドオプション、もしくは環境変数で構成ファイルの内容を上書きしたい。

Dockerから構成の内容を上書きする場合、Dockerの起動方法によっては環境変数でしかパラメータを渡すことが出来ない(コマンドラインオプションを渡せない)。そのため、ブートストラップがコマンドオプションのみの対応の場合は、Dockerのエントリポイントスクリプトで環境変数をコマンドオプションに変換して渡すことになる。

この機能の利用イメージはPostgreSQLのDockerイメージとほぼ同じ。
https://hub.docker.com/_/postgres

関連する議論のスレッド:
https://nautilus-rd.slack.com/archives/GB4QT920L/p1654741714845849

`tsurugi.pid` の配置ディレクトリ見直し

プロセス起動時に作られる tsurugi.pid が構成ファイルと同じディレクトリに作られるため、rootでインストールし、一般ユーザで起動するとPermission failedで起動に失敗する。

/tmp/<mangled/path/to/conf> など、インストール構成に依存しない箇所に配置すべき。

関連する議論のSlackスレッド:
https://nautilus-rd.slack.com/archives/GB4QT920L/p1655176329393129?thread_ts=1655106121.943689&cid=GB4QT920L

oltp backup createでWALがコピーされない

oltp backup createでWALがコピーされない

再現コード

以下をTsurugi Dockerイメージのコンテナ内で実行する。

#!/bin/bash

/usr/lib/tsurugi/bin/tgsql exec -c tcp://localhost:12345 "create table demo(pk int primary key, col2 bigint, col3 float, col4 double, col5 char(4), cal6 varchar(10), col7 varchar(3))" --no-auth
/usr/lib/tsurugi/bin/tgsql exec -c tcp://localhost:12345 "insert into demo(pk,col2,col3,col4,col5,cal6,col7) values (1,1,1.1,1.1,'1','1111', NULL)" --no-auth
/usr/lib/tsurugi/bin/tgsql exec -c tcp://localhost:12345 "insert into demo(pk,col2,col3,col4,col5,cal6,col7) values (2,2,2.2,2.2,'2','2222', NULL)" --no-auth
/usr/lib/tsurugi/bin/tgsql exec -c tcp://localhost:12345 "insert into demo(pk,col2,col3,col4,col5,cal6,col7) values (3,3,3.3,3.3,'3','3333', NULL)" --no-auth
/usr/lib/tsurugi/bin/tgsql exec -c tcp://localhost:12345 "select * from demo" --no-auth

echo "check TsurugiDB is running..."
/usr/lib/tsurugi/bin/oltp status --conf /usr/lib/tsurugi/conf/tsurugi.ini

echo "shutdown TsurugiDB..."
/usr/lib/tsurugi/bin/oltp shutdown --conf /usr/lib/tsurugi/conf/tsurugi.ini
sleep 3

echo "check TsurugiDB is stopped..."
/usr/lib/tsurugi/bin/oltp status --conf /usr/lib/tsurugi/conf/tsurugi.ini

echo "call oltp quiesce to be exclusive mode ..."
/usr/lib/tsurugi/bin/oltp quiesce --conf /usr/lib/tsurugi/conf/tsurugi.ini
sleep 3

echo "check TsurugiDB status after calling oltp quiesce..."
/usr/lib/tsurugi/bin/oltp status --conf /usr/lib/tsurugi/conf/tsurugi.ini

echo "create backup..."

MONITOR_LOG_DIR=/tmp/bk_offline
BK_DATA_DIR=/tmp/bk_offline_data

mkdir $MONITOR_LOG_DIR
mkdir $BK_DATA_DIR
/usr/lib/tsurugi/bin/oltp backup create ${BK_DATA_DIR} --monitor ${MONITOR_LOG_DIR}/monitor.log --conf /usr/lib/tsurugi/conf/tsurugi.ini --force

echo "------------"
ls -al ${BK_DATA_DIR}
echo "------------"
  • Expectation: epochとpwal_xxxxがコピーされる。
  • Actual: 最後の行でepochしかファイルができていない。

Version

  • Tsurugi Docker Image: ghcr.io/project-tsurugi/tsurugi latest 19718ac08ca7

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.