-
Notifications
You must be signed in to change notification settings - Fork 108
[Iris] Replace txn_log audit table with structured log lines #5082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -118,9 +118,14 @@ SELECT slice_id, lifecycle, scale_group, worker_ids FROM slices WHERE lifecycle= | |||||||||||||||||||||||||||||
| -- Task attempt history (debugging retries) | ||||||||||||||||||||||||||||||
| SELECT task_id, attempt_id, state, exit_code, error FROM task_attempts | ||||||||||||||||||||||||||||||
| WHERE task_id LIKE '%<job_fragment>%' ORDER BY attempt_id; | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Controller audit events (`event=<kind> action=<action> entity=<id> ...`) are | ||||||||||||||||||||||||||||||
| emitted as structured `logger.info` lines — query them through | ||||||||||||||||||||||||||||||
| `iris process logs` with a substring filter, not via SQL. Example: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| -- What the controller has been doing | ||||||||||||||||||||||||||||||
| SELECT kind, count(*) FROM txn_log GROUP BY kind ORDER BY count(*) DESC LIMIT 10; | ||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| iris process logs --since 24h | grep 'action=worker_heartbeat_failed' | ||||||||||||||||||||||||||||||
|
Comment on lines
+123
to
+128
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The grammar description and grep example don't match what
Suggested change
|
||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Full table list: `iris query "SELECT name FROM sqlite_master WHERE type='table'"`. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,8 +102,6 @@ | |
| "task_resource_history", | ||
| "endpoints", | ||
| "reservation_claims", | ||
| "txn_log", | ||
| "txn_actions", | ||
| "meta", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file has two more dangling references to the deleted
Since |
||
| "schema_migrations", | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright The Marin Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Drop the `txn_log` and `txn_actions` audit tables. | ||
|
|
||
| The controller no longer records mutating transitions to SQLite; every | ||
| state change now emits a semi-structured `logger.info` line via | ||
| ``transitions.log_event`` that is captured by the Iris log server and | ||
| queried through the normal log-store DuckDB interface. | ||
| """ | ||
|
|
||
| import sqlite3 | ||
|
|
||
|
|
||
| def migrate(conn: sqlite3.Connection) -> None: | ||
| conn.execute("DROP TRIGGER IF EXISTS trg_txn_log_retention") | ||
| conn.execute("DROP INDEX IF EXISTS idx_txn_actions_txn") | ||
| conn.execute("DROP TABLE IF EXISTS txn_actions") | ||
| conn.execute("DROP TABLE IF EXISTS txn_log") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event=keyThe new audit logging format emitted by controller transitions uses
event=<action>(for exampleevent=worker_heartbeat_failed), but this OPS example filters onaction=worker_heartbeat_failed; operators following it will miss the intended audit entries during debugging. Update the filter/example to match the emitted field name.Useful? React with 👍 / 👎.