Skip to content

Commit

Permalink
MDEV-24670 memory pressure - warnings/notes
Browse files Browse the repository at this point in the history
Errors outputted as notes are weird, and when a user
cannot do anything about them, why output them at all.

Point taken, removed these, and left positive message
on initialization (from Marko).

Thanks Elena Stepanova.
  • Loading branch information
grooverdan committed Dec 20, 2023
1 parent a057a6e commit 9d2c3d3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions storage/innobase/buf/buf0buf.cc
Expand Up @@ -786,24 +786,15 @@ class mem_pressure
if ((m_fds[m_num_fds].fd=
open(memcgroup.c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC)) < 0)
{
switch (errno) {
case EPERM:
/* https://lore.kernel.org/all/CAMw=ZnQ56cm4Txgy5EhGYvR+Jt4s-KVgoA9_65HKWVMOXp7a9A@mail.gmail.com/T/#m3bd2a73c5ee49965cb73a830b1ccaa37ccf4e427 */
sql_print_information("InnoDB: Failed to initialize memory pressure EPERM, "
"file permissions.");
break;
default:
sql_print_information("InnoDB: Failed to initialize memory pressure: %s",
strerror(errno));
}
/* User can't do anything about it, no point giving warning */
shutdown();
return false;
}
my_register_filename(m_fds[m_num_fds].fd, memcgroup.c_str(), FILE_BY_OPEN, 0, MYF(0));
ssize_t slen= strlen(*trig);
if (write(m_fds[m_num_fds].fd, *trig, slen) < slen)
{
sql_print_warning("InnoDB: Failed create trigger for memory pressure \"%s\"", *trig);
/* we may fail this one, but continue to the next */
my_close(m_fds[m_num_fds].fd, MYF(MY_WME));
continue;
}
Expand All @@ -815,7 +806,7 @@ class mem_pressure

if ((m_event_fd= eventfd(0, EFD_CLOEXEC|EFD_NONBLOCK)) == -1)
{
sql_print_warning("InnoDB: No memory pressure - can't create eventfd");
/* User can't do anything about it, no point giving warning */
shutdown();
return false;
}
Expand All @@ -824,6 +815,7 @@ class mem_pressure
m_fds[m_num_fds].events= POLLIN;
m_num_fds++;
m_thd= std::thread(pressure_routine, this);
sql_print_information("InnoDB: Initialized memory pressure event listener");
return true;
}

Expand Down

0 comments on commit 9d2c3d3

Please sign in to comment.