Skip to content

Comments

Fix zero timestamp in vifl#773

Merged
tanjinx merged 2 commits intoslack-19.0from
yqin-fix-zero-timestamp
Jan 20, 2026
Merged

Fix zero timestamp in vifl#773
tanjinx merged 2 commits intoslack-19.0from
yqin-fix-zero-timestamp

Conversation

@yushuqin
Copy link

@yushuqin yushuqin commented Jan 20, 2026

Description

  • MySQL returns "0000-00-00 00:00:00" for NULL timestamps when NO_ZERO_DATE sql_mode is not enabled
  • The valueToVTTime() function in go/vt/vtctl/grpcvtctldserver/query.go attempts to parse this value using Go's standard time.ParseInLocation()
  • Go's time parser rejects "0000-00-00 00:00:00" because "month 0" is invalid

Environment Difference(why only vifl keyspace is running into this issue):

  • vifl shards: sql_mode = NO_ENGINE_SUBSTITUTION only → stores '0000-00-00 00:00:00'
dbadmin@tablet-iad-dev-vifl-0000-0020-gl0n[_vt]>   SELECT
  ->       migration_uuid,
  ->       migration_status,
  ->       last_throttled_timestamp,
  ->       last_throttled_timestamp = '0000-00-00 00:00:00' as is_zero_timestamp
  ->   FROM _vt.schema_migrations
  ->   WHERE migration_status = 'complete'
  ->   LIMIT 5;
+--------------------------------------+------------------+--------------------------+-------------------+
| migration_uuid                       | migration_status | last_throttled_timestamp | is_zero_timestamp |
+--------------------------------------+------------------+--------------------------+-------------------+
| afa730b3_ed9e_11f0_af0e_0affe767f54d | complete         | 0000-00-00 00:00:00      |                 1 |
| f7232069_ed9e_11f0_af0e_0affe767f54d | complete         | 0000-00-00 00:00:00      |                 1 |
| a43c6f0e_eda0_11f0_af0e_0affe767f54d | complete         | 0000-00-00 00:00:00      |                 1 |
| 4bd8c6e4_eda3_11f0_af0e_0affe767f54d | complete         | 0000-00-00 00:00:00      |                 1 |
| fe90f2a9_eda3_11f0_af0e_0affe767f54d | complete         | 0000-00-00 00:00:00      |                 1 |
+--------------------------------------+------------------+--------------------------+-------------------+
5 rows in set (0.00 sec)
  • other shard: sql_mode includes STRICT_TRANS_TABLES → stores NULL
dbadmin@tablet-iad-staging-pool1-00-80-kx71[(none)]>   SELECT
    ->       migration_uuid,
    ->       migration_status,
    ->       last_throttled_timestamp,
    ->       last_throttled_timestamp = '0000-00-00 00:00:00' as is_zero_timestamp
    ->   FROM _vt.schema_migrations
    ->   WHERE migration_status = 'complete'
    ->   LIMIT 5;
+--------------------------------------+------------------+--------------------------+-------------------+
| migration_uuid                       | migration_status | last_throttled_timestamp | is_zero_timestamp |
+--------------------------------------+------------------+--------------------------+-------------------+
| 9ec5f164_cc41_11ee_a445_1264402010d7 | complete         | NULL                     |              NULL |
| abdb115b_cc41_11ee_a445_1264402010d7 | complete         | NULL                     |              NULL |
| dd68c4d5_e601_11ee_ad84_0e148289ab29 | complete         | NULL                     |              NULL |
| eea4bf57_e601_11ee_ad84_0e148289ab29 | complete         | NULL                     |              NULL |
| fd5aee11_e601_11ee_ad84_0e148289ab29 | complete         | NULL                     |              NULL |
+--------------------------------------+------------------+--------------------------+-------------------+
5 rows in set (0.01 sec)
  Error Call Stack

  vtops-go schema-change-executor monitor-change step
      ↓
      [gRPC call]
      ↓
  VtctldServer.GetSchemaMigrations()
      (go/vt/vtctl/grpcvtctldserver/server.go:1664)
      ↓
      [Query database: SELECT * FROM _vt.schema_migrations ...]
      ↓
  rowToSchemaMigration(row)
      (go/vt/vtctl/grpcvtctldserver/server.go:1771)
      ↓
  valueToVTTime(row.AsString("last_throttled_timestamp", ""))
      (go/vt/vtctl/grpcvtctldserver/query.go:154)
      ↓
  time.ParseInLocation("2006-01-02 15:04:05", "0000-00-00 00:00:00", time.Local)
      ↓
  ❌ ERROR: parsing time "0000-00-00 00:00:00": month out of range
      ↓
      [Error propagates back up the stack]
      ↓
  gRPC returns error with code = Unknown
      ↓
  vtops-go receives: "code = Unknown desc = parsing time ..."

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

AI Disclosure

@yushuqin yushuqin requested a review from a team as a code owner January 20, 2026 01:21
@github-actions github-actions bot added this to the v19.0.7 milestone Jan 20, 2026
@yushuqin yushuqin requested a review from tanjinx January 20, 2026 19:04
@tanjinx tanjinx merged commit a0d303e into slack-19.0 Jan 20, 2026
163 of 168 checks passed
@tanjinx tanjinx deleted the yqin-fix-zero-timestamp branch January 20, 2026 22:05
yushuqin added a commit that referenced this pull request Jan 27, 2026
Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
yushuqin added a commit that referenced this pull request Jan 27, 2026
Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
@yushuqin yushuqin mentioned this pull request Jan 27, 2026
5 tasks
tanjinx added a commit that referenced this pull request Jan 27, 2026
* Fix zero timestamp in vifl (#773)

Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>

* [`slack-19.0`]: backport: Increase GTID position column size to LONGBLOB for VReplication (vitessio#19119) (#770)

This backport increases the GTID position column size from BLOB to LONGBLOB
in VReplication tables to prevent data truncation for large GTID sets.

Backported from vitessio#19119
Original commit: fc242ff

Changes:
- Update schema_version.sql to use LONGBLOB for pos column
- Update vreplication.sql to use LONGBLOB for pos column
- Update schema tests to reflect new column type

Note: Test file changes from upstream were not included as they depend on
features not present in slack-19.0 branch. Core schema changes are sufficient.

* Fix GC table regex for lower case compatibility (#753)

Signed-off-by: 'Yushu Qin' <yqin@slack-corp.com>

---------

Signed-off-by: 'Yushu Qin' <yqin@slack-corp.com>
Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
sbaker617 pushed a commit that referenced this pull request Feb 5, 2026
* Fix zero timestamp in vifl (#773)

Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>

* [`slack-19.0`]: backport: Increase GTID position column size to LONGBLOB for VReplication (vitessio#19119) (#770)

This backport increases the GTID position column size from BLOB to LONGBLOB
in VReplication tables to prevent data truncation for large GTID sets.

Backported from vitessio#19119
Original commit: fc242ff

Changes:
- Update schema_version.sql to use LONGBLOB for pos column
- Update vreplication.sql to use LONGBLOB for pos column
- Update schema tests to reflect new column type

Note: Test file changes from upstream were not included as they depend on
features not present in slack-19.0 branch. Core schema changes are sufficient.

* Fix GC table regex for lower case compatibility (#753)

Signed-off-by: 'Yushu Qin' <yqin@slack-corp.com>

---------

Signed-off-by: 'Yushu Qin' <yqin@slack-corp.com>
Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants