Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c1e82405
Unverified
Commit
c1e82405
authored
Jun 20, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 20, 2018
Browse files
Merge pull request #5039 from oranagra/rdb_dbsize_hint
64 bit RDB_OPCODE_RESIZEDB in rdb saving
parents
79f55eed
5cd3c952
Changes
1
Show whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
c1e82405
...
@@ -1127,13 +1127,9 @@ int rdbSaveRio(rio *rdb, int *error, int flags, rdbSaveInfo *rsi) {
...
@@ -1127,13 +1127,9 @@ int rdbSaveRio(rio *rdb, int *error, int flags, rdbSaveInfo *rsi) {
* is currently the largest type we are able to represent in RDB sizes.
* is currently the largest type we are able to represent in RDB sizes.
* However this does not limit the actual size of the DB to load since
* However this does not limit the actual size of the DB to load since
* these sizes are just hints to resize the hash tables. */
* these sizes are just hints to resize the hash tables. */
uint32_t
db_size
,
expires_size
;
uint64_t
db_size
,
expires_size
;
db_size
=
(
dictSize
(
db
->
dict
)
<=
UINT32_MAX
)
?
db_size
=
dictSize
(
db
->
dict
);
dictSize
(
db
->
dict
)
:
expires_size
=
dictSize
(
db
->
expires
);
UINT32_MAX
;
expires_size
=
(
dictSize
(
db
->
expires
)
<=
UINT32_MAX
)
?
dictSize
(
db
->
expires
)
:
UINT32_MAX
;
if
(
rdbSaveType
(
rdb
,
RDB_OPCODE_RESIZEDB
)
==
-
1
)
goto
werr
;
if
(
rdbSaveType
(
rdb
,
RDB_OPCODE_RESIZEDB
)
==
-
1
)
goto
werr
;
if
(
rdbSaveLen
(
rdb
,
db_size
)
==
-
1
)
goto
werr
;
if
(
rdbSaveLen
(
rdb
,
db_size
)
==
-
1
)
goto
werr
;
if
(
rdbSaveLen
(
rdb
,
expires_size
)
==
-
1
)
goto
werr
;
if
(
rdbSaveLen
(
rdb
,
expires_size
)
==
-
1
)
goto
werr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment