mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:43:02 +01:00
Fixed CORE-2316: Throttling Nbackup on large databases
This commit is contained in:
parent
d848ced78a
commit
a6e066505b
@ -661,7 +661,7 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
|||||||
AC_CHECK_FUNCS(sem_timedwait)
|
AC_CHECK_FUNCS(sem_timedwait)
|
||||||
AC_CHECK_FUNCS(sem_init)
|
AC_CHECK_FUNCS(sem_init)
|
||||||
if test "$ac_cv_func_sem_init" = "yes"; then
|
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>
|
AC_TRY_RUN([#include <semaphore.h>
|
||||||
main () {
|
main () {
|
||||||
sem_t s;
|
sem_t s;
|
||||||
@ -675,6 +675,7 @@ fi
|
|||||||
CFLAGS="$savedFlags"
|
CFLAGS="$savedFlags"
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(semtimedop)
|
AC_CHECK_FUNCS(semtimedop)
|
||||||
|
AC_CHECK_FUNCS(posix_fadvise)
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
||||||
|
@ -366,10 +366,16 @@ void NBackup::open_database_scan()
|
|||||||
if (dbase == INVALID_HANDLE_VALUE)
|
if (dbase == INVALID_HANDLE_VALUE)
|
||||||
b_error::raise(uSvc, "Error (%d) opening database file: %s", GetLastError(), dbname.c_str());
|
b_error::raise(uSvc, "Error (%d) opening database file: %s", GetLastError(), dbname.c_str());
|
||||||
#else
|
#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)
|
if (dbase < 0)
|
||||||
b_error::raise(uSvc, "Error (%d) opening database file: %s", errno, dbname.c_str());
|
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()
|
void NBackup::create_database()
|
||||||
|
Loading…
Reference in New Issue
Block a user