Commit 9d2c3d38 authored by Daniel Black's avatar Daniel Black

MDEV-24670 memory pressure - warnings/notes

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.
parent a057a6e4
...@@ -786,16 +786,7 @@ class mem_pressure ...@@ -786,16 +786,7 @@ class mem_pressure
if ((m_fds[m_num_fds].fd= if ((m_fds[m_num_fds].fd=
open(memcgroup.c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC)) < 0) open(memcgroup.c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC)) < 0)
{ {
switch (errno) { /* User can't do anything about it, no point giving warning */
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));
}
shutdown(); shutdown();
return false; return false;
} }
...@@ -803,7 +794,7 @@ class mem_pressure ...@@ -803,7 +794,7 @@ class mem_pressure
ssize_t slen= strlen(*trig); ssize_t slen= strlen(*trig);
if (write(m_fds[m_num_fds].fd, *trig, slen) < slen) 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)); my_close(m_fds[m_num_fds].fd, MYF(MY_WME));
continue; continue;
} }
...@@ -815,7 +806,7 @@ class mem_pressure ...@@ -815,7 +806,7 @@ class mem_pressure
if ((m_event_fd= eventfd(0, EFD_CLOEXEC|EFD_NONBLOCK)) == -1) 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(); shutdown();
return false; return false;
} }
...@@ -824,6 +815,7 @@ class mem_pressure ...@@ -824,6 +815,7 @@ class mem_pressure
m_fds[m_num_fds].events= POLLIN; m_fds[m_num_fds].events= POLLIN;
m_num_fds++; m_num_fds++;
m_thd= std::thread(pressure_routine, this); m_thd= std::thread(pressure_routine, this);
sql_print_information("InnoDB: Initialized memory pressure event listener");
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment