log_manager.cc
Added new argument '-s' which takes additional argument composed of list of logfile identifiers. Logfiles listed with '-s' will be written on main memory instead of disk. In practice, the log file in question will be written in /dev/shm but corresponding symlink is added to log directory. In the case of name conflicts with log files and links, a differentiating sequence number is included in hte name of the file. This, however, is done only when existing file is not writable or is of different type (symlink <> file). Added new logfile LOGFILE_DEBUG whose contents will be largerly what was included up to date in trace log. Disabled feature which spreads writes to log files to others because of bug (#338) in the way block buffers are managed. Changed log manager parameters to match with the current implementation. List of arguments: "-h - help\n" "-a <debug prefix> ............(\"skygw_debug\")\n" "-b <debug suffix> ............(\".log\")\n" "-c <trace prefix> ............(\"skygw_trace\")\n" "-d <trace suffix> ............(\".log\")\n" "-e <message prefix> ............(\"skygw_msg\")\n" "-f <message suffix> ............(\".log\")\n" "-g <error prefix> ............(\"skygw_err\")\n" "-i <error suffix> ............(\".log\")\n" "-j <log path> ............(\"/tmp\")\n" "-s <shmem log file ids> ........(no default)\n"; dcb.c dcb_add_to_zombieslist, add dcb to the front of zombies list instead of inserting to the end of it. gateway.c Renamed shutdown_gateway to shutdown_server (Bug #131) Call skygw_logmanager_init so that trace and debug logs are written to shared memory. poll.c dcb.h Removed some dead code and references to unneeded mutexes. debugcmd.c Added enable/disable log command for debug log. skygw_utils.cc skygw_file_init now takes optional symlink name as a second argument. Symlink is created to point to the file being created.
This commit is contained in:
@ -343,9 +343,9 @@ poll_waitevents(void *arg)
|
||||
ss_dassert(dcb->state != DCB_STATE_DISCONNECTED);
|
||||
ss_dassert(dcb->state != DCB_STATE_FREED);
|
||||
ss_debug(spinlock_release(&dcb->dcb_initlock);)
|
||||
|
||||
skygw_log_write_flush(
|
||||
LOGFILE_DEBUG,
|
||||
|
||||
skygw_log_write(
|
||||
LOGFILE_TRACE,
|
||||
"%lu [poll_waitevents] event %d dcb %p "
|
||||
"role %s",
|
||||
pthread_self(),
|
||||
@ -388,7 +388,7 @@ poll_waitevents(void *arg)
|
||||
eno = gw_getsockerrno(dcb->fd);
|
||||
|
||||
skygw_log_write(
|
||||
LOGFILE_TRACE,
|
||||
LOGFILE_DEBUG,
|
||||
"%lu [poll_waitevents] "
|
||||
"EPOLLHUP on dcb %p, fd %d. "
|
||||
"Errno %d, %s.",
|
||||
@ -406,25 +406,13 @@ poll_waitevents(void *arg)
|
||||
eno = gw_getsockerrno(dcb->fd);
|
||||
|
||||
if (eno == 0) {
|
||||
#if 0
|
||||
simple_mutex_lock(
|
||||
&dcb->dcb_write_lock,
|
||||
true);
|
||||
ss_info_dassert(
|
||||
!dcb->dcb_write_active,
|
||||
"Write already active");
|
||||
dcb->dcb_write_active = TRUE;
|
||||
#endif
|
||||
atomic_add(&pollStats.n_write, 1);
|
||||
atomic_add(
|
||||
&pollStats.n_write,
|
||||
1);
|
||||
dcb->func.write_ready(dcb);
|
||||
#if 0
|
||||
dcb->dcb_write_active = FALSE;
|
||||
simple_mutex_unlock(
|
||||
&dcb->dcb_write_lock);
|
||||
#endif
|
||||
} else {
|
||||
skygw_log_write(
|
||||
LOGFILE_TRACE,
|
||||
LOGFILE_DEBUG,
|
||||
"%lu [poll_waitevents] "
|
||||
"EPOLLOUT due %d, %s. "
|
||||
"dcb %p, fd %i",
|
||||
@ -437,13 +425,6 @@ poll_waitevents(void *arg)
|
||||
}
|
||||
if (ev & EPOLLIN)
|
||||
{
|
||||
#if 0
|
||||
simple_mutex_lock(&dcb->dcb_read_lock,
|
||||
true);
|
||||
ss_info_dassert(!dcb->dcb_read_active,
|
||||
"Read already active");
|
||||
dcb->dcb_read_active = TRUE;
|
||||
#endif
|
||||
if (dcb->state == DCB_STATE_LISTENING)
|
||||
{
|
||||
skygw_log_write(
|
||||
@ -468,11 +449,6 @@ poll_waitevents(void *arg)
|
||||
atomic_add(&pollStats.n_read, 1);
|
||||
dcb->func.read(dcb);
|
||||
}
|
||||
#if 0
|
||||
dcb->dcb_read_active = FALSE;
|
||||
simple_mutex_unlock(
|
||||
&dcb->dcb_read_lock);
|
||||
#endif
|
||||
}
|
||||
} /**< for */
|
||||
no_op = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user