Skip to content

Fix bug 1617949 (HandlerSocket leaks thread objects)#937

Merged
laurynas-biveinis merged 1 commit intopercona:5.6from
laurynas-biveinis:bug1617949-5.6
Aug 31, 2016
Merged

Fix bug 1617949 (HandlerSocket leaks thread objects)#937
laurynas-biveinis merged 1 commit intopercona:5.6from
laurynas-biveinis:bug1617949-5.6

Conversation

@laurynas-biveinis
Copy link
Copy Markdown
Contributor

This is caused by hstcpsvr::threads, which is
auto_ptrcontainer<std::vector<worker_thread_type *> > (effectively
std::vector<foo *>), having clear() method, which clears the container
without deleting the member pointers, which are owned by the
container.

Fix by making clear delete the pointers, and by making destructor to
call clear instead of deleting pointers by itself.

http://jenkins.percona.com/job/percona-server-5.6-param/1341/
http://jenkins.percona.com/job/percona-server-5.6-valgrind/173/

delete *i;
}
cnt.clear();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For containers like this hiding copy constructor and assignment operator is also a good idea.

@percona-ysorokin
Copy link
Copy Markdown
Collaborator

LGTM

This is caused by hstcpsvr::threads, which is
auto_ptrcontainer<std::vector<worker_thread_type *> > (effectively
std::vector<foo *>), having clear() method, which clears the container
without deleting the member pointers, which are owned by the
container.

Fix by making clear delete the pointers, and by making destructor to
call clear instead of deleting pointers by itself.
@laurynas-biveinis
Copy link
Copy Markdown
Contributor Author

Updated to inherit from noncopyable, http://jenkins.percona.com/job/percona-server-5.6-param/1345/

@percona-ysorokin
Copy link
Copy Markdown
Collaborator

LGTM

@laurynas-biveinis laurynas-biveinis merged commit dd9182e into percona:5.6 Aug 31, 2016
@laurynas-biveinis laurynas-biveinis deleted the bug1617949-5.6 branch August 31, 2016 13:41
satya-bodapati added a commit to satya-bodapati/percona-server that referenced this pull request Feb 22, 2019
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lth

Differential Revision: D13890369

Pulled By: lth

fbshipit-source-id: 347fef40974
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 23, 2020
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Test Plan:
Added long user names to basic grant and replication tests.

Did full build and test run without perfschema, no failures.

Did full build and test run with perfschema, no new failures.

Jenkins both 'arc unit', and 'arc unit --everything', pass

Built a test rpm, ran it through rpm tests, passed.

Installed the test rpm on a test server, then downgraded it:
"use mysql; show create table user;", and got:
* Before upgrade: "...`User` char(16)..."
* After upgrade: "...`User` char(16)..."
* After restart: "...`User` char(16)..."
* After running mysql_upgrade: "...`User` char(80)..."
* After downgrade: "...`User` char(80)..."
* After restart: "...`User` char(80)..."
* After running mysql_upgrade: "...`User` char(16)..."

Reviewed By: lth

Differential Revision: D13890369

Pulled By: lth

fbshipit-source-id: 35f0728285a
inikep pushed a commit to inikep/percona-server that referenced this pull request Feb 24, 2021
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Test Plan:
Added long user names to basic grant and replication tests.

Did full build and test run without perfschema, no failures.

Did full build and test run with perfschema, no new failures.

Jenkins both 'arc unit', and 'arc unit --everything', pass

Built a test rpm, ran it through rpm tests, passed.

Installed the test rpm on a test server, then downgraded it:
"use mysql; show create table user;", and got:
* Before upgrade: "...`User` char(16)..."
* After upgrade: "...`User` char(16)..."
* After restart: "...`User` char(16)..."
* After running mysql_upgrade: "...`User` char(80)..."
* After downgrade: "...`User` char(80)..."
* After restart: "...`User` char(80)..."
* After running mysql_upgrade: "...`User` char(16)..."

Reviewed By: lth

Differential Revision: D13890369

Pulled By: lth

fbshipit-source-id: 35f0728285a
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 15, 2021
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369 (facebook/mysql-5.6@1075e57)

Pulled By: lth

fbshipit-source-id: 2ec67345fb8
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 15, 2022
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 15, 2022
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 18, 2022
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Apr 12, 2022
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 15, 2024
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 16, 2024
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 17, 2024
Summary:
https://jira.percona.com/browse/FB8-47

The max user name length is increased to 80 chars (utf8mb3)
Since the system tables are InnoDB tables and because Primary key is
on the full username (80 *3 = 240 bytes) and other columns, InnoDb
initialization with 4k page size fails.

This is new limitation.

Reference Patch: facebook/mysql-5.6@3dbbcfc

This mitigates upstream bug: http://bugs.mysql.com/3083

User name length limit of 16 was too short, so made it 80.

80 is effectively the limit without making additional changes
because of MyISAM's 1000 byte limit on key length and the
primary key of mysql.columns_priv. To compute the size of
the key for that table, the lengths of the char fields are
summed and then multipled by 3, resulting in a limit on the
max size of user name lengths being 81 characters.
Pull Request resolved: facebook/mysql-5.6#937

Reviewed By: lloyd

Differential Revision: D13890369

Pulled By: lth
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