本文へ移動
cccskills
無料GitHub で公開日本語紹介

debug-fuzz

WALファジーテストの失敗を、固定シードから再現し、列型変換やParquet・ネイティブ形式間の変換履歴とパーティション状態を追って原因を絞り込むスキルです。

原文原文の説明を見る

Debug a failing WAL fuzz test involving column conversions and parquet partitions

questdb/questdbスター 17,474(GitHub 17,474 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • シード指定でWALの失敗を再現したいとき
  • 列型変換の値違いを調べたいとき
  • Parquet変換前後の差を追いたいとき
  • NULLやcolumn topの不一致を調査したいとき

日本語での紹介

できること

debug-fuzz は、QuestDBのWALファジーテストで列変換やParquetパーティションに関係する失敗を調べます。失敗ログやテスト名から乱数シードを確認し、同じ操作列を再現できる状態かを見ます。そのうえで、非WALテーブルを基準として、WALの逐次・並列処理との結果差を追跡します。列の追加・削除・改名、型変換の連鎖、パーティション形式の変換や削除を時系列で整理し、失敗行がどのパーティションにあり、列の型やcolumn topがどう変化したかを確認します。必要に応じて、各トランザクション後のテーブル状態を記録する一時ログを追加して根本原因を絞ります。

こんなときに便利

固定シードのWALテストが失敗し、列の値や型が非WAL側と一致しないときに使えます。Parquetとの往復後の値違い、NULLと番兵値の違い、列追加後のパーティション状態などを追う調査に向いています。

使い方の例

  • 「このWALファズテストの失敗ログから原因を調べて」
  • 「このシードで列変換の不一致を追って」
  • 「Parquet変換後に値がずれる理由を調査して」

注意点

テストの実行例ではMavenを使います。失敗を再現できるシードが必要です。ファズテストの操作列を保つため、テスト回数・確率・機能フラグは変更せず、一時的なデバッグログで状態を確認します。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md6.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Debug the fuzz test failure described by $ARGUMENTS.

Background

WAL fuzz tests (WalWriterFuzzTest, AbstractFuzzTest) are nearly deterministic with fixed seeds. The same seeds produce the same sequence of operations. Failures reproduce reliably once you have the seeds.

The test applies the same randomly-generated transactions three ways:

  1. Non-WAL table — direct writer, ground truth
  2. WAL sequential — single WAL writer
  3. WAL parallel ple concurrent WAL writers

TestUtils.assertSqlCursors() compares WAL tables against non-WAL. The assertion format is: Row N column COL[TYPE] expected:<X> but was:<Y>.

Step 1: Get the seeds

Find the random seeds in the test output:

random seeds: 137113830825708L, 1776424558803L

If the user provided a failure log, extract the seeds from there and compare them against the seeds currently hardcoded in the test method. If the test uses generateRandom(LOG) (no fixed seeds), note this — you'll need to hardcode the failing seeds to reproduce later.

If the seeds are already hardcoded in the test and match the failure log, no reproduction step is needed — proceed directly to tracing.

Step 3: Trace the column lifecycle

This is the most important step for conversion-related failures. For each column involved in the assertion failure, build a chronological timeline of:

  1. Column add — when the column was added, which partitions already existed. Partitions created before the column was added have a column top (the column starts at a row offset within that partition, not at row 0).

  2. Column delete / rename — removals and renames that affect the column index chain.

  3. Column type conversions (ALTER COLUMN TYPE) — each conversion creates a new column index via replacingIndex. Track the full chain of types (e.g., INT → STRING → DATE). Key file: ConvertOperatorImpl.java.

  4. Partition format conversions — CONVERT PARTITION TO PARQUET and TO NATIVE. A parquet partition freezes the column type at conversion time. If a type change happened after parquet conversion, the parquet partition stores the old type. The ConvertOperatorImpl pre-pass converts parquet partitions to native when needed (chained conversions, symbol targets).

  5. Partition truncations (DROP PARTITION) — partitions removed mid-sequence change what data exists when later operations run.

Use Grep to search the fuzz generator and operation classes for LOG statements that trace these operations:

core/src/test/java/io/questdb/test/cairo/fuzz/FuzzChangeColumnTypeOperation.java
core/src/test/java/io/questdb/test/cairo/fuzz/FuzzConvertPartitionToParquetOperation.java
core/src/test/java/io/questdb/test/cairo/fuzz/FuzzConvertPartitionToNativeOperation.java
core/src/test/java/io/questdb/test/cairo/fuzz/FuzzTransactionGenerator.java
core/src/main/java/io/questdb/griffin/ConvertOperatorImpl.java

Step 4: Cross-reference with the failure

Map the failing assertion back to the timeline:

  • Which partition holds the failing row (based on its timestamp)?
  • Was that partition in parquet format at any point?
  • What type did the column have when the partition was converted to/from parquet?
  • Does the column have a column top in that partition (was it added after the partition)?

Step 5: Add debug logging

Do NOT change fuzz counts, probabilities, or feature gates. Fuzz tests are extremely sensitive to any modification — even a tiny change alters the random sequence and produces completely different transactions, making the failure non-reproducible.

Instead, add temporary debug logging to dump table state after each transaction. Useful things to log after each WAL apply / transaction commit:

  • Row count per partition (native and parquet)
  • Column tops for the failing column (and its replacingIndex chain) across all partitions
  • Partition list with format (native/parquet) and timestamp ranges
  • Column metadata: type, index in metadata, replacingIndex chain
  • Partition format changes (log when a partition switches between native and parquet)

Add logging in AbstractFuzzTest.runFuzz() or in the WAL apply loop. For example, after each transaction is applied, iterate over partitions and dump the state of the columns involved in the failure.

Also useful:

node1.setProperty(PropertyKey.DEBUG_WAL_APPLY_BLOCK_FAILURE_NO_RETRY, true);

Step 6: Identify root cause

Common failure patterns:

SymptomLikely causeWhere to look
Data mismatch after parquet round-tripParquet decoder type mappingcore/rust/qdbr/src/parquet_read/decode.rs
Wrong value in converted columnPre-pass missed a parquet partitionConvertOperatorImpl.java pre-pass logic
Symbol column errors from parquetParquet not converted to native before symbol conversionConvertOperatorImpl.java isTargetSymbol check
NULL vs sentinel mismatchType conversion doesn't handle NULL for non-nullable typesConversion logic for BYTE/SHORT/BOOLEAN
Column top mismatchColumn top not propagated to new column indexcolumnVersionWriter.upsertColumnTop() in ConvertOperatorImpl

Key files

  • core/src/test/java/io/questdb/test/cairo/fuzz/WalWriterFuzzTest.java — test entry points
  • core/src/test/java/io/questdb/test/cairo/fuzz/AbstractFuzzTest.java — runFuzz(), comparison logic
  • core/src/test/java/io/questdb/test/cairo/fuzz/FuzzTransactionGenerator.java — operation generation
  • core/src/test/java/io/questdb/test/cairo/fuzz/FuzzChangeColumnTypeOperation.java — type change logic
  • core/src/main/java/io/questdb/griffin/ConvertOperatorImpl.java — column type conversion engine
  • core/src/main/java/io/questdb/cairo/TableWriter.java — partition format, column tops
  • core/rust/qdbr/src/parquet_read/decode.rs — parquet type decoding

Running

# Single method from repo root
mvn test --batch-mode \
  -Dtest.include="%regex[.*WalWriterFuzzTest.*]" \
  -Dtest="**/WalWriterFuzzTest.java#testConvertPartitionToParquet" \
  -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false \
  -pl questdb/core

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

approve-pr

無料概要あり

直近のコードレビュー結果を対象ブランチのPRに承認として投稿し、「QUEUED FOR MERGE」ラベルを付けるスキルです。

  • レビュー済みPRを承認したいとき
  • マージ待ちラベルを追加したいとき
  • レビュー報告をPRに投稿したいとき
questdb/questdb1.7万2026年10月26日 更新

debug-fuzz-top

無料概要あり

QuestDBのWAL/O3テスト失敗を調べ、複合パーティションの形状や行配置を手掛かりに原因を絞り込むスキルです。

  • WAL/O3テストの失敗原因を追いたいとき
  • ランダムシードで失敗を再現したいとき
  • 複合パーティションの再現テストを作りたいとき
questdb/questdb1.7万2026年10月26日 更新

fix-ci

無料概要あり

PRのCI状況を確認し、失敗したテストやビルドの内容を調べて原因を分類します。機械的に直せる期待値のずれは修正し、判断が必要な問題は利用者に相談します。

  • PRのCI失敗をまとめたいとき
  • 失敗したテスト名とエラーを調べたいとき
  • 変更後の期待値をテストへ反映したいとき
questdb/questdb1.7万2026年10月26日 更新

fix-pr

無料概要あり

QuestDBのPR指摘を原因や呼び出し元への影響まで調べ、設計レビューと回帰テストを経て適切な修正を進めるスキルです。

  • PR指摘の原因を調査したいとき
  • 修正の呼び出し元への影響を確認したいとき
  • 設計レビュー後に回帰テスト付きで直したいとき
questdb/questdb1.7万2026年10月26日 更新

fix-pr

無料概要あり

QuestDBのPRレビューで指摘された項目を一件ずつ検証し、必要に応じて再現テスト、修正、テスト実行、独立レビューまで進めるスキルです。

  • レビュー指摘の妥当性を確かめたいとき
  • 不具合を回帰テストで再現したいとき
  • 確認済みの指摘を絞って修正したいとき
questdb/questdb1.7万2026年10月26日 更新

fix-pr

無料概要あり

QuestDBのPRレビュー指摘を一件ずつ検証し、影響を確かめたうえで回帰テストと独立レビューを通して修正するスキルです。

  • PR指摘の真偽を確かめたいとき
  • 不具合を再現する回帰テストを作りたいとき
  • 影響範囲を調べて修正したいとき
questdb/questdb1.7万2026年10月26日 更新

questdb のスキルをすべて見る

このスキルの問題を報告する