Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
my_thread_id, the type of many thread_id variables/functions, is a readability typedef of uint64 de jure, but long-standing formats (such as the client-server protocol and the binary log) hard-coded `my_thread_id` to 32 bits in practice. In fact –
In mysqld.cc, static recalculate_thread_id_range() places a grand limit of (0, UINT_MAX32) on my_thread_id next_thread_id(void) and aborts the program when there’re “2^32 connections”.
To prevent inconsistent-size bugs (such as MDEV-35646) once and for all, we should change it to a typedef of uint32_t to reflect its de facto range.
There appears to be thread_id-named variables/functions that don’tcan’t make use of the my_thread_id typedef – some are ulonglong (64-bit) and some ulong/unsigned long (64-bit on Linux, 32-bit on Windows) (including slave_proxy_id of sql/log_event.h, the old name of pseudo_thread_id).
Any thread_id users among them should convert to my_thread_id to join the consistency’s cause.
(I tried to do this as part of MDEV-35646; a few files in but none understood uintXX of my_global.h (nor uintXX_t of MDEV-35460).
Attachments
Issue Links
- causes
-
MDEV-15089 Ensure that connection ID is in 32bit range
-
- Closed
-
-
MDEV-35646 pseudo_thread_id Can Overflow on Binlog Write
-
- Closed
-
- split to
-
MDEV-35707 Sys_var_XXX types should be fixed-typed, not by how many ‘long’s
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue causes |
Summary | Shrink my_thread_it to uint32_t | Shrink my_thread_id to uint32_t |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
Link | This issue split to MDEV-35707 [ MDEV-35707 ] |
Link |
This issue causes |
Labels | tech_debt |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but due to binary log format specifications, only 4 bytes are valid ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but long-standing formats (such as the client-server protocol and the binary log ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
Description |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but long-standing formats (such as the client-server protocol and the binary log ( bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |
{{my_thread_id}}, the type of many {{thread_id}} variables/functions, is a readability typedef of {{uint64}} _de jure_, but long-standing formats (such as the client-server protocol and the binary log) hard-coded `my_thread_id` to 32 bits in practice. In fact –
bq. In {{mysqld.cc}}, {{static recalculate_thread_id_range()}} places a grand limit of {{(0, UINT_MAX32)}} on {{my_thread_id next_thread_id(void)}} and aborts the program when there’re “2^32 connections”. To prevent inconsistent-size bugs (such as There appears to be {{thread_id}}\-named variables/functions that -don’t-+can’t+ make use of the {{my_thread_id}} typedef – some are {{ulonglong}} (64-bit) and some {{ulong}}/{{unsigned long}} (64-bit on Linux, 32-bit on Windows) (including {{slave_proxy_id}} of {{sql/log_event.h}}, the old name of {{pseudo_thread_id}}). Any {{thread_id}} users among them should convert to {{my_thread_id}} to join the consistency’s cause. (I tried to do this as part of |