summaryrefslogtreecommitdiff
path: root/src/conn
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-08-12 03:02:58 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2016-08-12 17:02:58 +1000
commit707807a81fbf06766006b8d63393414205fda181 (patch)
tree8c039560c34d282489269877ce7a45244800e0e9 /src/conn
parentf69bbc18148c6fced50b01e04d552f0053fce20c (diff)
downloadmongo-707807a81fbf06766006b8d63393414205fda181.tar.gz
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.
Diffstat (limited to 'src/conn')
-rw-r--r--src/conn/conn_log.c15
1 files changed, 8 insertions, 7 deletions
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);