From 707807a81fbf06766006b8d63393414205fda181 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 12 Aug 2016 03:02:58 -0400 Subject: WT-2823 support file handles without a truncate method (#2940) * Rework the block manager to ignore whether or not truncate works at a low-level, rather than handling errors we don't care about in the callers. --- src/conn/conn_log.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/conn') diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c index 18ed71e4688..06b23086c69 100644 --- a/src/conn/conn_log.c +++ b/src/conn/conn_log.c @@ -353,8 +353,7 @@ __wt_log_truncate_files( backup_file = WT_CURSOR_BACKUP_ID(cursor); WT_ASSERT(session, backup_file <= log->alloc_lsn.l.file); WT_RET(__wt_verbose(session, WT_VERB_LOG, - "log_truncate_files: Archive once up to %" PRIu32, - backup_file)); + "log_truncate_files: Archive once up to %" PRIu32, backup_file)); WT_RET(__wt_writelock(session, log->log_archive_lock)); locked = true; @@ -429,12 +428,14 @@ __log_file_server(void *arg) */ WT_ERR(__wt_fsync(session, close_fh, true)); /* - * We want to make sure the file size reflects - * actual data and has minimal pre-allocated - * zeroed space. + * We want to have the file size reflect actual + * data with minimal pre-allocated zeroed space. + * The underlying file system may not support + * truncate, which is OK, it's just more work + * during cursor traversal. */ - WT_ERR(__wt_ftruncate(session, - close_fh, close_end_lsn.l.offset)); + WT_ERR_ERROR_OK(__wt_ftruncate(session, + close_fh, close_end_lsn.l.offset), ENOTSUP); WT_SET_LSN(&close_end_lsn, close_end_lsn.l.file + 1, 0); __wt_spin_lock(session, &log->log_sync_lock); -- cgit v1.2.1