8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Fixed CORE-2316: Throttling Nbackup on large databases

This commit is contained in:
alexpeshkoff 2009-03-06 17:56:05 +00:00
parent d848ced78a
commit a6e066505b
2 changed files with 10 additions and 3 deletions

View File

@ -661,7 +661,7 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_CHECK_FUNCS(sem_timedwait)
AC_CHECK_FUNCS(sem_init)
if test "$ac_cv_func_sem_init" = "yes"; then
AC_MSG_CHECKING(for working sem_int())
AC_MSG_CHECKING(for working sem_init())
AC_TRY_RUN([#include <semaphore.h>
main () {
sem_t s;
@ -675,6 +675,7 @@ fi
CFLAGS="$savedFlags"
fi
AC_CHECK_FUNCS(semtimedop)
AC_CHECK_FUNCS(posix_fadvise)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN

View File

@ -366,10 +366,16 @@ void NBackup::open_database_scan()
if (dbase == INVALID_HANDLE_VALUE)
b_error::raise(uSvc, "Error (%d) opening database file: %s", GetLastError(), dbname.c_str());
#else
dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE);
dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE | O_NOATIME | O_DIRECT);
if (dbase < 0)
b_error::raise(uSvc, "Error (%d) opening database file: %s", errno, dbname.c_str());
#endif
#ifdef HAVE_POSIX_FADVISE
if (posix_fadvise(dbase, 0, 0, POSIX_FADV_SEQUENTIAL) < 0)
b_error::raise(uSvc, "Error (%d) in posix_fadvise(SEQUENTIAL) for %s", errno, dbname.c_str());
if (posix_fadvise(dbase, 0, 0, POSIX_FADV_NOREUSE) < 0)
b_error::raise(uSvc, "Error (%d) in posix_fadvise(NOREUSE) for %s", errno, dbname.c_str());
#endif //HAVE_POSIX_FADVISE
#endif //WIN_NT
}
void NBackup::create_database()