summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-07-16 15:30:55 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-16 06:02:32 +0000
commit4b4f320b0c2726748ab46d2c1a9b025b8e4f9365 (patch)
tree8c7e5160eb717afad937b058a202e4020b7ed68f /src/third_party/wiredtiger
parente9837b379acbc1bd0096dced516b1e160df186da (diff)
downloadmongo-4b4f320b0c2726748ab46d2c1a9b025b8e4f9365.tar.gz
Import wiredtiger: 19190bd88d594f5f7ab02303afc6f59dd4f0ea60 from branch mongodb-master
ref: 0d87872310..19190bd88d for: 5.1.0 WT-7837 Clear updates structure in wt_hs_insert_updates to avoid firing assert
Diffstat (limited to 'src/third_party/wiredtiger')
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/history/hs_rec.c1
-rw-r--r--src/third_party/wiredtiger/test/suite/test_hs24.py28
-rw-r--r--src/third_party/wiredtiger/test/suite/test_hs25.py73
4 files changed, 103 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 07264a75c9a..0121c2ce825 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "0d87872310d00cc1ca39122d825dbb2f6f8badc5"
+ "commit": "19190bd88d594f5f7ab02303afc6f59dd4f0ea60"
}
diff --git a/src/third_party/wiredtiger/src/history/hs_rec.c b/src/third_party/wiredtiger/src/history/hs_rec.c
index 907547f3dea..8375de8ffdf 100644
--- a/src/third_party/wiredtiger/src/history/hs_rec.c
+++ b/src/third_party/wiredtiger/src/history/hs_rec.c
@@ -714,6 +714,7 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi,
}
#endif
__wt_update_vector_clear(&out_of_order_ts_updates);
+ __wt_update_vector_clear(&updates);
}
WT_ERR(__wt_block_manager_named_size(session, WT_HS_FILE, &hs_size));
diff --git a/src/third_party/wiredtiger/test/suite/test_hs24.py b/src/third_party/wiredtiger/test/suite/test_hs24.py
index 0631774ded4..4c4ee4a4b94 100644
--- a/src/third_party/wiredtiger/test/suite/test_hs24.py
+++ b/src/third_party/wiredtiger/test/suite/test_hs24.py
@@ -1,3 +1,31 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-present MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
import wttest, threading, wiredtiger
from helper import simulate_crash_restart
diff --git a/src/third_party/wiredtiger/test/suite/test_hs25.py b/src/third_party/wiredtiger/test/suite/test_hs25.py
new file mode 100644
index 00000000000..e353ce076fe
--- /dev/null
+++ b/src/third_party/wiredtiger/test/suite/test_hs25.py
@@ -0,0 +1,73 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-present MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+import wttest
+
+def timestamp_str(t):
+ return '%x' % t
+
+# test_hs25.py
+# Ensure updates structure is correct when processing each key.
+class test_hs25(wttest.WiredTigerTestCase):
+ conn_config = 'cache_size=50MB'
+ session_config = 'isolation=snapshot'
+ uri = 'table:test_hs25'
+
+ def test_insert_updates_hs(self):
+ self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(1))
+ self.conn.set_timestamp('stable_timestamp=' + timestamp_str(1))
+ self.session.create(self.uri, 'key_format=i,value_format=S')
+ s = self.conn.open_session()
+
+ # Update the first key.
+ cursor1 = self.session.open_cursor(self.uri)
+ self.session.begin_transaction()
+ cursor1[1] = 'a'
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(2))
+
+ # Update the second key.
+ self.session.begin_transaction()
+ cursor1[2] = 'a'
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(2))
+ self.session.begin_transaction()
+ cursor1[2] = 'b'
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(3))
+
+ # Prepared update on the first key.
+ self.session.begin_transaction()
+ cursor1[1] = 'b'
+ cursor1[1] = 'c'
+ self.session.prepare_transaction('prepare_timestamp=' + timestamp_str(4))
+
+ # Run eviction cursor.
+ s.begin_transaction('ignore_prepare=true')
+ evict_cursor = s.open_cursor(self.uri, None, 'debug=(release_evict)')
+ self.assertEqual(evict_cursor[1], 'a')
+ self.assertEqual(evict_cursor[2], 'b')
+ s.rollback_transaction()
+ self.session.rollback_transaction()