summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conn/conn_api.c2
-rw-r--r--src/cursor/cur_join.c10
-rw-r--r--src/log/log.c18
-rw-r--r--src/reconcile/rec_write.c9
4 files changed, 34 insertions, 5 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index 521e6068137..0599dfee390 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -2035,7 +2035,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
__conn_config_append(cfg, version);
/* Ignore the base_config file if config_base_set is false. */
- if (config_base_set || F_ISSET(conn, WT_CONN_READONLY))
+ if (config_base_set)
WT_ERR(
__conn_config_file(session, WT_BASECONFIG, false, cfg, i1));
__conn_config_append(cfg, config);
diff --git a/src/cursor/cur_join.c b/src/cursor/cur_join.c
index 66c254c181e..1ee26716212 100644
--- a/src/cursor/cur_join.c
+++ b/src/cursor/cur_join.c
@@ -751,6 +751,7 @@ __curjoin_next(WT_CURSOR *cursor)
WT_SESSION_IMPL *session;
bool skip_left;
u_int i;
+ const uint8_t *p;
cjoin = (WT_CURSOR_JOIN *)cursor;
@@ -799,7 +800,14 @@ nextkey:
* retrieve values from the cursor join.
*/
c = iter->main;
- c->set_key(c, iter->curkey);
+ if (WT_CURSOR_RECNO(cursor) &&
+ !F_ISSET(cursor, WT_CURSTD_RAW)) {
+ p = (const uint8_t *)iter->curkey->data;
+ WT_ERR(__wt_vunpack_uint(&p, iter->curkey->size,
+ &cjoin->iface.recno));
+ c->set_key(c, cjoin->iface.recno);
+ } else
+ c->set_key(c, iter->curkey);
if ((ret = c->search(c)) != 0)
WT_ERR(c->search(c));
F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
diff --git a/src/log/log.c b/src/log/log.c
index 28fff0c2f25..aabf629f867 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -8,6 +8,8 @@
#include "wt_internal.h"
+static int __log_openfile(
+ WT_SESSION_IMPL *, bool, WT_FH **, const char *, uint32_t);
static int __log_write_internal(
WT_SESSION_IMPL *, WT_ITEM *, WT_LSN *, uint32_t);
@@ -93,8 +95,9 @@ __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn)
int
__wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
{
- WT_LOG *log;
WT_DECL_RET;
+ WT_FH *log_fh;
+ WT_LOG *log;
log = S2C(session)->log;
@@ -129,12 +132,21 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
* Sync the log file if needed.
*/
if (__wt_log_cmp(&log->sync_lsn, min_lsn) < 0) {
+ /*
+ * Get our own file handle to the log file. It is possible
+ * for the file handle in the log structure to change out
+ * from under us and either be NULL or point to a different
+ * file than we want.
+ */
+ WT_ERR(__log_openfile(session,
+ false, &log_fh, WT_LOG_FILENAME, min_lsn->l.file));
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
"log_force_sync: sync %s to LSN %" PRIu32 "/%" PRIu32,
- log->log_fh->name, min_lsn->l.file, min_lsn->l.offset));
- WT_ERR(__wt_fsync(session, log->log_fh, true));
+ log_fh->name, min_lsn->l.file, min_lsn->l.offset));
+ WT_ERR(__wt_fsync(session, log_fh, true));
log->sync_lsn = *min_lsn;
WT_STAT_FAST_CONN_INCR(session, log_sync);
+ WT_ERR(__wt_close(session, &log_fh));
WT_ERR(__wt_cond_signal(session, log->log_sync_cond));
}
err:
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 873482df131..eae7f24725a 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -2575,6 +2575,15 @@ __rec_split_raw_worker(WT_SESSION_IMPL *session,
dsk->type == WT_PAGE_COL_VAR)
r->raw_recnos[slots] = recno;
r->raw_entries[slots] = entry;
+
+ /*
+ * Don't create an image so large that any future update will
+ * cause a split in memory. Use half of the maximum size so
+ * we split very compressible pages that have reached the
+ * maximum size in memory into two equal blocks.
+ */
+ if (len > (size_t)btree->maxmempage / 2)
+ break;
}
/*