Throwback to 2023

After a busy holiday season, things finally calmed down a bit in February, and I look back on the last year, albeit late.

From January to March, I did a system migration, went to Paris in April, changed jobs in May, and had a great time traveling a lot and participating in the local technical community. I have developed new hobbies: sake, Japanese food cooking, and pottery. Karatsu is going to be my favorite place. I also worked hard on my blog, Zenn, LT, and other outputs along the way.

Recently, I started to get busy with new things at work and my mind has been leaning toward anxiety for a long time. I don't know if I am choosing smart solutions, but every day I want to love myself for trying to do my best. I am sure that I am doing something that I can only do now, so I hope that I can look back later and appreciate what I am doing now and have good memories - I hope.

But there have been a lot of interesting things since I joined my current company, and I'm loving my job more and more, and I'm glad I met my coworkers who make me feel that way.

On the physical side, I'm having a hard time with some bad hair loss and gastroenteritis, and my hair has been getting especially messed up lately, so I'm wondering if there is a good way to take care of it. To myself this summer: thank you so much for all your hard work.

ER_WARN_I_S_SKIPPED_TABLE / Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement とは

見慣れないエラーに遭遇したので調べてみた。

https://github.com/mysql/mysql-server/blob/8.0/sql/sql_show.cc#L718

コメントにあるように、特定のテーブルのメタデータロックが競合した場合に発生するエラーのようです。

We are in situation when we have encountered conflicting metadata lock and deadlocks can occur due to waiting for it to go away. So instead of waiting skip this table with an appropriate warning.

https://github.com/mysql/mysql-server/blob/8.0/sql/sql_show.cc#L670

  • とあるスレッドがSHOWI_S (Information Schema)へのステートメントを発行するとき、MDL_SHARED_HIGH_PRIO でMDLを取得しようとする
    • https://github.com/mysql/mysql-server/blob/8.0/sql/sql_show.cc#L670
    • lock_wait_timeout ぶん待機してMDLを取得しようとする場合と、待機しない場合がある(以下の場合は待機しないらしい)
      • When .FRM is being open in order to get data for an I_S table, we might have some tables not only open but also locked. E.g. this happens when a SHOW or I_S statement is run under LOCK TABLES or inside a stored function. By waiting for the conflicting metadata lock to go away we might create a deadlock which won't entirely belong to the MDL subsystem and thus won't be detectable by this subsystem's deadlock detector. To avoid such situation, when there are other locked tables, we prefer not to wait on a conflicting lock.

    • when a SHOW or I_S statement is run under LOCK TABLES or inside a stored function. のunderというのは、他のスレッドでロックしているという意味でよいのかわからず...
  • すでに別のスレッドが対象のテーブルを MDL_EXCLUSIVE でMDLを取得していると、ロックが取得できずエラーになる

上記のコメントにも記載の通り、このケースでロックを待った場合に発生しうるデッドロックは、通常のデッドロック検知機構によって検知されないため、ロックを待たずに掲題のエラーにするようです。

How to solve rbenv install 3.2.2 error on M2 Mac

Due to Homebew of Rosetta version, I struggled with installing ruby 3.2.2 by rbenv.

Here is the error.

*** Following extensions are not compiled:
psych:
        Could not be configured. It will not be installed.
        Check ext/psych/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
Generating RDoc documentation
/private/var/folders/_0/n4zrvrn14y15r7g522ypt8tm0000gn/T/ruby-build.20230516235445.90248.zsr1nZ/ruby-3.2.2/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
uh-oh! RDoc had a problem:
cannot load such file -- psych

run with --debug for full backtrace
make: *** [rdoc] Error 1

I tried these and it worked for me:

Uninstall Rosetta version of Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

Reinstall Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install libyaml

brew install libyaml

Specify libyaml's path by RUBY_CONFIGURE_OPTS arg on Ruby installation

RUBY_CONFIGURE_OPTS=--with-libyaml-dir="$(brew --prefix libyaml)" rbenv --debug install 3.2.2

References:

https://blog.furu07yu.com/entry/rbenv-ruby-install-on-m1

https://github.com/rbenv/ruby-build/discussions/2118

Initial commit by English

Finally logged in and changed my password of this account after Twitter API issue! This spring, I spent my holiday for a while in Paris and Matsumoto.

Meanwhile, I migrated and added some monitorings of my former company's site from Mackerel to Datadog, by Terraform. Whole activity was new experience to me.

On my job change, some conversations and words encourage and tie me to this world. I love my friends and colleagues :)

I hope things go with me.

2022年(主に後半)の振り返り

2022年後半、自分としては濃い半年を送った気がするので振り返りしておきます。

業務

AWS移行の仕事がしたかったのもあって新しい部署に異動し、文字通りオンプレのシステムをAWSに移行していくという仕事をしていました。

移行するときになるべくモダン&シンプルなアーキテクチャに整えていくとの信条のもと、デプロイや本番作業、開発環境等の周辺環境も整えていきました。(詳しくは後述のブログに記載あり)

移行していく中で、WebサーバやDB、インフラの基礎的な知識を少し強めることができたと思い、自信につながったかなと思います。

また、古いシステムを運営しているがゆえに思わぬハマりどころも多く、OSSのコードリーディングの機会が増えてかえって勉強になりました。

まだまだ移行の仕事は残っていますがデータセンタの契約期間というタイムリミットがあるため、時間をかけすぎないものの整えられるところは整えるいい塩梅を探りながらキリをつけられればと思います。

あとはチームでテックブログの運営も行っていましたが、多数の方々のご尽力の結果目標を上回る記事数やPVを出すことができたので、今後もまずは継続を目指しつつ新しい取り組みを何か考えたいです。

執筆

ご縁あって、会社の同僚とSoftware Designの特集に寄稿させていただきました。

私はトラブル発生時の調査に使うSQLについて書きましたが、正しい知識を伝えるためにあらためて自分でもしっかりと調査することになり、とても勉強になりました。レビュー、編集、広報でたくさんの方にお世話になり、企画の話をいただいてから雑誌を出すまでにいろいろな人が関わっていることを寄稿者の立場ながらに感じました。ありがとうございました。

gihyo.jp

あとは、このブログと会社のテックブログでたくさん記事を書きました。

AWS移行の仕事をしていたこともありAWSの話題が多めになっています。

副業

11月に知人の紹介で副業を始めましたが、急ぎではないがやっておきたいといったことをやる機会が多くとても勉強になっています。

元々自分が別の仕事でユーザーだった好きなプロダクトを作っている会社なので、始めたばかりですが楽しく働かせていただいています。

個人開発

年の前半は、会社の先輩や他社の友人とプロダクト開発していたのですが忙しくなってしまいいつの間にか手付かずに。。コンセプトはとても好きなので、また形にできればなと思います。

その後は自分がこういうものが欲しい、と思った瞬間に形にするという作業を行い、ちょっとしたツールをたくさん作ってしまいました。SlackマスキングのChrome拡張は社内で紹介したらご好評いただき嬉しかったです。他のものはほぼユーザーがおらず、主に自分だけが愛用している状態です。

クオリティを気にせずにアウトプットできるようになったのは自分の精神的な成長を感じつつ、来年は実際に使ってもらえるようなクオリティの高い作品を作れるようになりたいです。とはいえ、自己満足の開発もとても楽しいので続けてしまいそうです。。

github.com

chrome.google.com

chrome.google.com

www.npmjs.com

最後に

来年はどこに行ってもリードエンジニアができることを目標に、仕事の質と周囲への影響力を高められたらと思います。 引き続き、自分ができる範囲でのアウトプットを続けて、世の中から得た学びを還元していきたいです。