Compare commits

..
Author SHA1 Message Date
benschermel ee16abf020 update deb changelog and references 2022-05-24 15:59:08 -04:00
John Sully a9511e7d08 Version bump 2022-05-20 20:42:31 +00:00
John Sully 91d09756f7 Merge branch 'main' into RELEASE_6_3 2022-05-20 20:42:11 +00:00
John Sully 38310ec9f6 On Alpine we must have a reasonable stack size 2022-05-20 16:40:20 -04:00
John Sully ea4941a3e7 Fix crash in expire when a snapshot is in flight. Caused by a perf optimization getting the expire map out of sync with the val 2022-05-20 13:07:26 -04:00
John Sully 5dbf1f6bd6 Fix O(n^2) algorithm in the GC cleanup logic 2022-05-19 21:46:55 -04:00
John Sully ba1275f653 Fix TSAN warnings on the repl backlog 2022-05-17 15:37:22 -04:00
John Sully 20766a02b8 Disable async commands by default 2022-05-17 15:37:22 -04:00
John Sully a9d3490f9c Silence TSAN errors on ustime and mstime. Every CPU we support is atomic on aligned ints, but correctness matters 2022-05-17 15:37:22 -04:00
John Sully 8405c99017 Add fence barriers for the repl backlog (important for AARCH64 and other weak memory models) 2022-05-17 15:37:22 -04:00
John Sully 027ad50581 Dictionary use correct acquire/release semantics 2022-05-17 15:37:22 -04:00
John Sully e38537202e Avoid unnecessary rehashing when a rehash is abandoned 2022-05-17 15:37:22 -04:00
John Sully 8d8aabb978 Prevent us from starting a rehash when one wasn't already in progress. This can cause severe issues for snapshots 2022-05-17 15:37:22 -04:00
John Sully 418356c03a Initialize noshrink, it was dangling 2022-05-17 15:37:22 -04:00
John Sully 3caf6060c4 Prevent crash on shutdown by avoiding dtors (they are unnecessary anyways) 2022-05-17 15:37:22 -04:00
John Sully 9e138815a1 Fix assertion in async rehash 2022-05-17 15:37:22 -04:00
John Sully 51d3e2cbbc Fix reference counting failure in the dict. This is caused by std::swap also swapping refcounts 2022-05-17 15:37:22 -04:00
jfinity 242d6aabb2 Fix Readme typo from github org transition
Replace mention of scratch-file-path with db-s3-object
2022-05-12 16:55:14 -04:00
John Sully e2e1b4d5d5 Update license 2022-05-12 13:27:46 -04:00
benschermel 03287d69be update deb master changelog 2022-05-12 13:27:46 -04:00
John Sully aa2143f19b Delete COPYING 2022-05-12 13:18:20 -04:00
John Sully 02e9f948b7 Set version 2022-05-12 12:51:26 +00:00
10 changed files with 54 additions and 27 deletions

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@ Avoid forwarding RREPLAY messages to other masters? WARNING: This setting is dan
```
scratch-file-path /path
db-s3-object /path/to/bucket
```
If you would like KeyDB to dump and load directly to AWS S3 this option specifies the bucket. Using this option with the traditional RDB options will result in KeyDB backing up twice to both locations. If both are specified KeyDB will first attempt to load from the local dump file and if that fails load from S3. This requires the AWS CLI tools to be installed and configured which are used under the hood to transfer the data.
+2 -2
View File
@@ -23,8 +23,8 @@ pkg_name=keydb-$majorv:$version$distname
# create build tree
cd ../../../
tar -czvf keydb_$version.orig.tar.gz --force-local keydb-internal
cd keydb-internal/pkg/deb/
tar -czvf keydb_$version.orig.tar.gz --force-local KeyDB
cd KeyDB/pkg/deb/
mkdir -p $pkg_name/tmp
if [[ "$codename" == "xenial" ]] || [[ "$codename" == "stretch" ]]; then
cp -r debian_dh9 $pkg_name/tmp/debian
+2 -2
View File
@@ -26,8 +26,8 @@ Build-Depends:
libzstd-dev <!nocheck>
Standards-Version: 4.2.1
Homepage: https://docs.keydb.dev/
Vcs-Git: https://github.com/EQ-Alpha/KeyDB.git
Vcs-Browser: https://github.com/EQ-Alpha/KeyDB
Vcs-Git: https://github.com/Snapchat/KeyDB.git
Vcs-Browser: https://github.com/Snapchat/KeyDB
Package: keydb
Architecture: all
+2 -2
View File
@@ -25,8 +25,8 @@ Build-Depends:
libzstd-dev <!nocheck>
Standards-Version: 4.2.1
Homepage: https://docs.keydb.dev/
Vcs-Git: https://github.com/EQ-Alpha/KeyDB.git
Vcs-Browser: https://github.com/EQ-Alpha/KeyDB
Vcs-Git: https://github.com/Snapchat/KeyDB.git
Vcs-Browser: https://github.com/Snapchat/KeyDB
Package: keydb
Architecture: all
+8
View File
@@ -1,3 +1,11 @@
keydb (6:6.3.1-1distribution_placeholder) codename_placeholder; urgency=medium
* This point release contains fixes to bugs related to expires, active-rep, and rdb saving
* Issues fixed: #419, #422, #428
* PRs: #426, #429, #431, #433
-- Ben Schermel <ben@eqalpha.com> Mon, 23 May 2022 20:00:37 +0000
keydb (6:6.3.0-1distribution_placeholder) codename_placeholder; urgency=medium
* This release open sources KeyDB Enterprise features into the open source project along with PSYNC for active replication
+5
View File
@@ -2669,6 +2669,11 @@ void redisDbPersistentData::prepOverwriteForSnapshot(char *key)
auto itr = m_pdbSnapshot->find_cached_threadsafe(key);
if (itr.key() != nullptr)
{
if (itr.val()->FExpires()) {
// Note: I'm sure we could handle this, but its too risky at the moment.
// There are known bugs doing this with expires
return;
}
sds keyNew = sdsdupshared(itr.key());
if (dictAdd(m_pdictTombstone, keyNew, (void*)dictHashKey(m_pdict, key)) != DICT_OK)
sdsfree(keyNew);
+17 -14
View File
@@ -2,6 +2,7 @@
#include <vector>
#include <assert.h>
#include <unordered_set>
#include <list>
struct ICollectable
{
@@ -45,14 +46,14 @@ public:
void shutdown()
{
std::unique_lock<fastlock> lock(m_lock);
m_vecepochs.clear();
m_listepochs.clear();
m_setepochOutstanding.clear();
}
bool empty() const
{
std::unique_lock<fastlock> lock(m_lock);
return m_vecepochs.empty();
return m_listepochs.empty();
}
void endEpoch(uint64_t epoch, bool fNoFree = false)
@@ -63,12 +64,12 @@ public:
m_setepochOutstanding.erase(epoch);
if (fNoFree)
return;
std::vector<EpochHolder> vecclean;
std::list<EpochHolder> listclean;
// No outstanding epochs?
if (m_setepochOutstanding.empty())
{
vecclean = std::move(m_vecepochs); // Everything goes!
listclean = std::move(m_listepochs); // Everything goes!
}
else
{
@@ -77,18 +78,20 @@ public:
return; // No available epochs to free
// Clean any epochs available (after the lock)
for (size_t iepoch = 0; iepoch < m_vecepochs.size(); ++iepoch)
for (auto itr = m_listepochs.begin(); itr != m_listepochs.end(); /* itr incremented in loop*/)
{
auto &e = m_vecepochs[iepoch];
auto &e = *itr;
auto itrNext = itr;
++itrNext;
if (e < minepoch)
{
vecclean.emplace_back(std::move(e));
m_vecepochs.erase(m_vecepochs.begin() + iepoch);
--iepoch;
listclean.emplace_back(std::move(e));
m_listepochs.erase(itr);
}
itr = itrNext;
}
assert(vecclean.empty() || fMinElement);
assert(listclean.empty() || fMinElement);
}
lock.unlock(); // don't hold it for the potentially long delete of vecclean
@@ -100,13 +103,13 @@ public:
serverAssert(m_setepochOutstanding.find(epoch) != m_setepochOutstanding.end());
serverAssert(sp->FWillFreeChildDebug() == false);
auto itr = std::find(m_vecepochs.begin(), m_vecepochs.end(), m_epochNext+1);
if (itr == m_vecepochs.end())
auto itr = std::find(m_listepochs.begin(), m_listepochs.end(), m_epochNext+1);
if (itr == m_listepochs.end())
{
EpochHolder e;
e.tstamp = m_epochNext+1;
e.m_vecObjs.push_back(std::move(sp));
m_vecepochs.emplace_back(std::move(e));
m_listepochs.emplace_back(std::move(e));
}
else
{
@@ -117,7 +120,7 @@ public:
private:
mutable fastlock m_lock { "Garbage Collector"};
std::vector<EpochHolder> m_vecepochs;
std::list<EpochHolder> m_listepochs;
std::unordered_set<uint64_t> m_setepochOutstanding;
uint64_t m_epochNext = 0;
};
+3 -2
View File
@@ -2743,9 +2743,10 @@ void readQueryFromClient(connection *conn) {
parseClientCommandBuffer(c);
if (g_pserver->enable_async_commands && !serverTL->disable_async_commands && listLength(g_pserver->monitors) == 0 && (aeLockContention() || serverTL->rgdbSnapshot[c->db->id] || g_fTestMode)) {
// Frequent writers aren't good candidates for this optimization, they cause us to renew the snapshot too often
// so we exclude them unless the snapshot we need already exists
// so we exclude them unless the snapshot we need already exists.
// Note: In test mode we want to create snapshots as often as possibl to excercise them - we don't care about perf
bool fSnapshotExists = c->db->mvccLastSnapshot >= c->mvccCheckpoint;
bool fWriteTooRecent = (((getMvccTstamp() - c->mvccCheckpoint) >> MVCC_MS_SHIFT) < static_cast<uint64_t>(g_pserver->snapshot_slip)/2);
bool fWriteTooRecent = !g_fTestMode && (((getMvccTstamp() - c->mvccCheckpoint) >> MVCC_MS_SHIFT) < static_cast<uint64_t>(g_pserver->snapshot_slip)/2);
// The check below avoids running async commands if this is a frequent writer unless a snapshot is already there to service it
if (!fWriteTooRecent || fSnapshotExists) {
+12 -2
View File
@@ -1657,13 +1657,18 @@ int launchRdbSaveThread(pthread_t &child, rdbSaveInfo *rsi)
g_pserver->rdbThreadVars.tmpfileNum++;
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
if (pthread_create(&child, NULL, rdbSaveThread, args)) {
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setstacksize(&tattr, 1 << 23); // 8 MB
if (pthread_create(&child, &tattr, rdbSaveThread, args)) {
pthread_attr_destroy(&tattr);
for (int idb = 0; idb < cserver.dbnum; ++idb)
g_pserver->db[idb]->endSnapshot(args->rgpdb[idb]);
args->~rdbSaveThreadArgs();
zfree(args);
return C_ERR;
}
pthread_attr_destroy(&tattr);
g_pserver->child_type = CHILD_TYPE_RDB;
}
return C_OK;
@@ -3834,7 +3839,11 @@ int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {
g_pserver->rdbThreadVars.tmpfileNum++;
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
if (pthread_create(&child, nullptr, rdbSaveToSlavesSocketsThread, args)) {
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setstacksize(&tattr, 1 << 23); // 8 MB
if (pthread_create(&child, &tattr, rdbSaveToSlavesSocketsThread, args)) {
pthread_attr_destroy(&tattr);
serverLog(LL_WARNING,"Can't save in background: fork: %s",
strerror(errno));
@@ -3860,6 +3869,7 @@ int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {
closeChildInfoPipe();
return C_ERR;
}
pthread_attr_destroy(&tattr);
g_pserver->child_type = CHILD_TYPE_RDB;
serverLog(LL_NOTICE,"Background RDB transfer started");
+2 -2
View File
@@ -1,5 +1,5 @@
#define KEYDB_REAL_VERSION "255.255.255"
#define KEYDB_VERSION_NUM 0x00ffffff
#define KEYDB_REAL_VERSION "6.3.1"
#define KEYDB_VERSION_NUM 0x00060301
extern const char *KEYDB_SET_VERSION; // Unlike real version, this can be overriden by the config
enum VersionCompareResult