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
98d184db
Commit
98d184db
authored
Sep 06, 2017
by
antirez
Browse files
Streams: Save stream->length in RDB.
parent
cd18f06e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
98d184db
...
...
@@ -786,6 +786,11 @@ ssize_t rdbSaveObject(rio *rdb, robj *o) {
}
raxStop
(
&
ri
);
/* Save the number of elements inside the stream. We cannot obtain
* this easily later, since our macro nodes should be checked for
* number of items: not a great CPU / space tradeoff. */
if
((
n
=
rdbSaveLen
(
rdb
,
s
->
length
))
==
-
1
)
return
-
1
;
nwritten
+=
n
;
/* Save the last entry ID. */
if
((
n
=
rdbSaveLen
(
rdb
,
s
->
last_id
.
ms
))
==
-
1
)
return
-
1
;
nwritten
+=
n
;
...
...
@@ -1467,7 +1472,8 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
if
(
!
retval
)
rdbExitReportCorruptRDB
(
"Listpack re-added with existing key"
);
}
/* Load total number of items inside the stream. */
s
->
length
=
rdbLoadLen
(
rdb
,
NULL
);
/* Load the last entry ID. */
s
->
last_id
.
ms
=
rdbLoadLen
(
rdb
,
NULL
);
s
->
last_id
.
seq
=
rdbLoadLen
(
rdb
,
NULL
);
...
...
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