tdfs4ds.process_store.followup_upgrade¶
tdfs4ds.process_store.followup_upgrade
¶
FS_FOLLOW_UP: statistics and the opt-in primary index change (0.3.8.4).
Pure builders return SQL text and never run it; the few functions that write take an execute callable
(default: execute_query with raise_error=True) so tests can record the order.
Columns and view of the table never change, so older clients keep working.
STATISTICS_COLUMNS
module-attribute
¶
COLUMNS
module-attribute
¶
COLUMNS = ('RUN_ID', 'PROCESS_TYPE', 'PROCESS_ID', 'START_DATETIME', 'END_DATETIME', 'VALIDTIME_DATE', 'APPLIED_FILTER', 'STATUS')
sql_literal
¶
Escape value for use inside a single-quoted SQL string literal.
For the DBC probes and catalog predicates that compare a name as data
(WHERE DatabaseName = '…'). The caller supplies the surrounding quotes.
follow_up_statistics_sql
¶
The COLLECT STATISTICS statements for the follow-up table (base statistics options).
collect_follow_up_statistics
¶
Run the statements one by one. Fail-open: a failure is logged at DEBUG, never raised.
collect_follow_up_statistics_quietly
¶
Throttled hook (once per STATISTICS_EVERY_SECONDS per Python process); never raises.
primary_index_sql
¶
The read of the follow-up table's primary index columns (in order).
primary_index_is_target
¶
True when the index columns read are exactly PROCESS_ID.
new_table_ddl
¶
The CREATE of <FS_FOLLOW_UP>_NEW: same columns as today's table, PRIMARY INDEX (PROCESS_ID).
migration_statements
¶
The ordered statements of the change (dry-run text). Counts are verified between copy and swap.
apply_primary_index
¶
Do the change. read(sql) returns rows, execute(sql) runs a statement.
Refuses (RuntimeError) while a RUNNING row started within the last hour. The old table is kept as
<FS_FOLLOW_UP>_OLD; a second call (index already right) drops it.