mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 00:03:03 +01:00
Backported fix for CORE-2316: Throttling Nbackup on large databases
This commit is contained in:
parent
0888aa8da4
commit
cdd4323c7d
@ -684,7 +684,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;
|
||||
@ -698,6 +698,7 @@ fi
|
||||
CFLAGS="$savedFlags"
|
||||
fi
|
||||
AC_CHECK_FUNCS(semtimedop)
|
||||
AC_CHECK_FUNCS(posix_fadvise)
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_BIGENDIAN
|
||||
|
@ -329,10 +329,16 @@ void nbackup::open_database_scan()
|
||||
if (dbase == INVALID_HANDLE_VALUE)
|
||||
b_error::raise("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("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()
|
||||
|
Loading…
Reference in New Issue
Block a user