Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Namespaces #374

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3c4212f
implemented basic support for namespaces (this only adds support for …
ederuiter Oct 16, 2021
b8561cf
implemented database allocation + acl namespace support
ederuiter Oct 22, 2021
25e3744
make sure db allocation is always present when selecting a different …
ederuiter Oct 23, 2021
d3cd457
fix debug htstats to work with namespaces
ederuiter Oct 23, 2021
eb311cf
make sure fake replication client also has a namespace
ederuiter Oct 23, 2021
c8c4828
fix rreplay tests to also include allocate calls (this is needed as i…
ederuiter Oct 23, 2021
9adb05c
added actual namespace switching in ACLAuthenticateUser
ederuiter Oct 24, 2021
4254348
added basic namespace tests
ederuiter Oct 24, 2021
71aa119
Move master initialization out of config parsing; this caused issues …
ederuiter Oct 29, 2021
acda6f2
Fix flushall + emptyDbStucture + debug loadaof
ederuiter Oct 29, 2021
9b98faf
Added database mapping + namespace to client list output + added comp…
ederuiter Oct 29, 2021
05b631e
Namespace fixes for rdb/aof/scripting
ederuiter Oct 29, 2021
8434366
redisMaster->staleKeyMap is not always initialized, only delete it wh…
ederuiter Oct 29, 2021
c2efd10
added support for ::auto namespace + support for default user namespa…
ederuiter Nov 1, 2021
ace526f
forgot to commit generateAutoNamespaceName implementation
ederuiter Nov 1, 2021
d0e5165
Added SELECTNS admin command to switch to databases in other namespaces
ederuiter Nov 6, 2021
0f47216
Added last_allocated_db to prevent looping over all databases every time
ederuiter Nov 6, 2021
6cadb8c
Reset last_allocated_db after emptying all databases
ederuiter Nov 6, 2021
160d443
Move script cache to namespace
ederuiter Nov 6, 2021
ac5c4e3
Added command stats per namespace + output them in the info command
ederuiter Nov 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/replication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3285,7 +3285,8 @@ void freeMasterInfo(redisMaster *mi)
zfree(mi->masteruser);
if (mi->repl_transfer_tmpfile)
zfree(mi->repl_transfer_tmpfile);
delete mi->staleKeyMap;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s actually a bug in our delete override that makes this unsafe. You should be able to delete a null pointer. We have a fix coming.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that explains it, I came across it when debugging some random memory corruption issues and valgrind pointed to here for an invalid delete.

if (mi->staleKeyMap != nullptr)
delete mi->staleKeyMap;
if (mi->cached_master != nullptr)
freeClientAsync(mi->cached_master);
if (mi->master != nullptr)
Expand Down