Page MenuHomePhabricator

Column cu_log.cul_type incorrectly has a default value set on s1
Closed, ResolvedPublic

Description

According to the query I ran in T356631#9512754 on db2153, the column cul_type on cu_log incorrectly has a default set. The correct type of the cul_type column is VARBINARY(30) NOT NULL and instead on db2153 the type is varbinary(30) NOT NULL DEFAULT ''.

The full output from db2153 (for reference):

wikiadmin2023@10.192.0.4(enwiki)> show create table cu_log\G
*************************** 1. row ***************************
       Table: cu_log
Create Table: CREATE TABLE `cu_log` (
  `cul_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cul_timestamp` varbinary(14) NOT NULL DEFAULT '',
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
  `cul_target_id` int(10) unsigned NOT NULL DEFAULT 0,
  `cul_target_text` blob NOT NULL,
  `cul_target_hex` varbinary(255) NOT NULL DEFAULT '',
  `cul_range_start` varbinary(255) NOT NULL DEFAULT '',
  `cul_range_end` varbinary(255) NOT NULL DEFAULT '',
  `cul_actor` bigint(20) unsigned NOT NULL,
  `cul_reason_id` bigint(20) unsigned NOT NULL,
  `cul_reason_plaintext_id` bigint(20) unsigned NOT NULL,
  `cul_result_id` bigint(20) unsigned NOT NULL DEFAULT 0,
  `cul_result_plaintext_id` bigint(20) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`cul_id`),
  KEY `cul_timestamp` (`cul_timestamp`),
  KEY `cul_type_target` (`cul_type`,`cul_target_id`,`cul_timestamp`),
  KEY `cul_target_hex` (`cul_target_hex`,`cul_timestamp`),
  KEY `cul_range_start` (`cul_range_start`,`cul_timestamp`),
  KEY `cul_actor_time` (`cul_actor`,`cul_timestamp`)
) ENGINE=InnoDB AUTO_INCREMENT=878564 DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED
1 row in set (0.000 sec)

Event Timeline

Dreamy_Jazz renamed this task from Type of cu_log.cul_type is mismatched to the schema on db2153 to Type of cu_log.cul_type is incorrect to the expected on at least db2153.Feb 5 2024, 12:13 PM
Dreamy_Jazz created this task.
Dreamy_Jazz renamed this task from Type of cu_log.cul_type is incorrect to the expected on at least db2153 to Column cu_log.cul_type incorrectly has a default value set on db2153.Feb 5 2024, 12:19 PM

This happens not only on db2153 but in all s1 (enwiki).

# /home/marostegui/section s1 | while read host port; do echo "$host:$port"; db-mysql $host:$port enwiki -e  "show create table cu_log\G" | grep "cul_type" | grep -v "KEY" ; done
dbstore1008.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2188.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2186.codfw.wmnet:3311
ERROR 1146 (42S02) at line 1: Table 'enwiki.cu_log' doesn't exist
db2176.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2174.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2173.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2170.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2167.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2153.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2146.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2145.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2141.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2130.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2116.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2112.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2103.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db2102.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1235.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1234.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1232.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1228.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1219.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1218.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1207.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1206.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1196.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1186.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1184.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1169.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1163.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1154.eqiad.wmnet:3311
ERROR 1146 (42S02) at line 1: Table 'enwiki.cu_log' doesn't exist
db1140.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1139.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1135.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL DEFAULT '',
db1133.eqiad.wmnet:3306
Marostegui renamed this task from Column cu_log.cul_type incorrectly has a default value set on db2153 to Column cu_log.cul_type incorrectly has a default value set on s1.Feb 7 2024, 7:29 AM
Marostegui triaged this task as Medium priority.
Marostegui moved this task from Blocked to Ready on the DBA board.

Alter needed:

alter table cu_log change cul_type cul_type varbinary(30) not null;
Marostegui claimed this task.

I have fixed this

dbstore1008.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db2188.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2176.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2174.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2173.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2170.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db2167.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db2153.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2146.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2145.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2141.codfw.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db2130.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2116.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2112.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2103.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db2102.codfw.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1240.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db1239.eqiad.wmnet:3311
  `cul_type` varbinary(30) NOT NULL,
db1235.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1234.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1232.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1228.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1219.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1218.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1207.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1206.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1196.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1186.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1184.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1169.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,
db1163.eqiad.wmnet:3306
  `cul_type` varbinary(30) NOT NULL,