Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed)

Created:
8 years, 2 months ago by vishwath
Modified:
8 years, 2 months ago
Reviewers:
rlarocque, akalin
CC:
chromium-reviews, Raghu Simha, haitaol1, tim (not reviewing)
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Changed DB to store node positions as Ordinals. As part of the effort to move away from int64 based node positions, changed the DB to store server_position_in_node as an ordinal (represented by a varchar) instead. Also updated unittests and the latest db version number (now at 81). BUG=145412 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=160774

Patch Set 1 #

Total comments: 2

Patch Set 2 : Changed field from varchar to blob, improved tests #

Total comments: 5

Patch Set 3 : Fixed errors and corrected migration logic. #

Total comments: 23

Patch Set 4 : Implemented feedback changes. #

Total comments: 41

Patch Set 5 : Minor changes and corrections #

Total comments: 7

Patch Set 6 : Undid sql/ changes and changed column name #

Patch Set 7 : Minor fixes #

Total comments: 8

Patch Set 8 : Changed server_position to server_ordinal in DB #

Total comments: 43

Patch Set 9 : Invalid ordinals handling and minor fixes #

Total comments: 1

Patch Set 10 : More fixes #

Patch Set 11 : Ordinal default ctor now creates invalid Ordinals #

Total comments: 45

Patch Set 12 : Added SetUpVersion81Database() fn. #

Total comments: 15

Patch Set 13 : Minor fixes #

Total comments: 4

Patch Set 14 : Moar minor changes #

Patch Set 15 : Fixed memory leak error in unittest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+580 lines, -65 lines) Patch
M sync/engine/build_commit_command.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -2 lines 0 comments Download
M sync/engine/process_commit_response_command.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +10 lines, -4 lines 0 comments Download
M sync/engine/process_updates_command.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -1 line 0 comments Download
M sync/engine/syncer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -3 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 4 5 6 7 5 chunks +10 lines, -5 lines 0 comments Download
M sync/engine/syncer_util.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -2 lines 0 comments Download
M sync/syncable/directory.cc View 1 2 3 4 5 6 7 8 4 chunks +12 lines, -7 lines 0 comments Download
M sync/syncable/directory_backing_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +75 lines, -11 lines 0 comments Download
M sync/syncable/directory_backing_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +296 lines, -1 line 0 comments Download
M sync/syncable/entry.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M sync/syncable/entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +10 lines, -3 lines 0 comments Download
M sync/syncable/entry_kernel.h View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +28 lines, -13 lines 0 comments Download
M sync/syncable/entry_kernel.cc View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M sync/syncable/mutable_entry.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M sync/syncable/mutable_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +22 lines, -7 lines 0 comments Download
M sync/syncable/syncable_columns.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -4 lines 0 comments Download
M sync/syncable/syncable_enum_conversions.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M sync/syncable/syncable_enum_conversions.cc View 1 2 3 4 5 6 7 2 chunks +11 lines, -1 line 0 comments Download
M sync/syncable/syncable_enum_conversions_unittest.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M sync/syncable/syncable_id.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M sync/syncable/syncable_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +43 lines, -0 lines 0 comments Download
M sync/test/test_directory_backing_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (0 generated)
vishwath
I'm not entirely sure that I've covered the intended scope of #2, so feel free ...
8 years, 2 months ago (2012-09-27 23:02:49 UTC) #1
rlarocque
Some initial comments. https://codereview.chromium.org/10989063/diff/1/sync/syncable/directory_backing_store_unittest.cc File sync/syncable/directory_backing_store_unittest.cc (right): https://codereview.chromium.org/10989063/diff/1/sync/syncable/directory_backing_store_unittest.cc#newcode2086 sync/syncable/directory_backing_store_unittest.cc:2086: // Unfortunately there isn't a SetUpVersion80Database ...
8 years, 2 months ago (2012-09-27 23:10:12 UTC) #2
vishwath
Sure, I'll find out from Nicholas and get have that fixed. Would that be considered ...
8 years, 2 months ago (2012-09-27 23:16:14 UTC) #3
vishwath
I've changed the field from a varchar to a blob. Also added the SetupVersion80Database() function ...
8 years, 2 months ago (2012-09-28 01:24:53 UTC) #4
rlarocque
https://codereview.chromium.org/10989063/diff/5001/sync/syncable/directory_backing_store.cc File sync/syncable/directory_backing_store.cc (right): https://codereview.chromium.org/10989063/diff/5001/sync/syncable/directory_backing_store.cc#newcode1018 sync/syncable/directory_backing_store.cc:1018: "ALTER COLUMN server_position_in_parent VARCHAR(255)")) { This is should be ...
8 years, 2 months ago (2012-09-28 01:43:40 UTC) #5
vishwath
I think it should be fine now.
8 years, 2 months ago (2012-09-28 20:48:35 UTC) #6
rlarocque
Some comments. http://codereview.chromium.org/10989063/diff/5002/sync/syncable/directory_backing_store.cc File sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/10989063/diff/5002/sync/syncable/directory_backing_store.cc#newcode54 sync/syncable/directory_backing_store.cc:54: // to using ordinals instead of int64's ...
8 years, 2 months ago (2012-09-29 01:13:42 UTC) #7
vishwath
Implemented most of the feedback. Also, some of the changes affect sql/connection{h,cc,unittest} and sql/statement.h. Who ...
8 years, 2 months ago (2012-10-01 20:39:12 UTC) #8
rlarocque
The owners of the SQL code are listed in sql/OWNERS file. I did a random ...
8 years, 2 months ago (2012-10-01 21:45:55 UTC) #9
erikwright (departed)
+shess, the preferred reviewer for sql/ changes unless he's absent. -me
8 years, 2 months ago (2012-10-01 22:47:58 UTC) #10
akalin
http://codereview.chromium.org/10989063/diff/15001/sync/syncable/directory_backing_store.cc File sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/10989063/diff/15001/sync/syncable/directory_backing_store.cc#newcode54 sync/syncable/directory_backing_store.cc:54: // to using ordinals instead of int64's int64's int64s ...
8 years, 2 months ago (2012-10-01 23:13:35 UTC) #11
vishwath
I think I've fixed everything (famous last words I presume) http://codereview.chromium.org/10989063/diff/15001/sql/connection.cc File sql/connection.cc (right): http://codereview.chromium.org/10989063/diff/15001/sql/connection.cc#newcode15 ...
8 years, 2 months ago (2012-10-02 01:06:33 UTC) #12
rlarocque
A few more comments. I only skimmed the SQL section, since we're waiting for shess's ...
8 years, 2 months ago (2012-10-02 01:39:50 UTC) #13
Scott Hess - ex-Googler
I'm not sure I understand why you need to change sql/ at all. AFAICT, you're ...
8 years, 2 months ago (2012-10-02 03:58:47 UTC) #14
vishwath
Changes to sql/ have been removed. (I've removed shess from the reviewer list but will ...
8 years, 2 months ago (2012-10-02 19:25:59 UTC) #15
rlarocque
I think you should look into why RefreshColumns() isn't working. Which columns does it fail ...
8 years, 2 months ago (2012-10-02 21:48:21 UTC) #16
akalin
http://codereview.chromium.org/10989063/diff/30001/sync/syncable/directory_backing_store.cc File sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/10989063/diff/30001/sync/syncable/directory_backing_store.cc#newcode25 sync/syncable/directory_backing_store.cc:25: #include "sync/internal_api/public/base/ordinal.h" i think you can include just node_ordinal.h, ...
8 years, 2 months ago (2012-10-02 22:43:00 UTC) #17
vishwath
Having the freedom to use a different column has made the migration logic for 80->81 ...
8 years, 2 months ago (2012-10-04 21:46:11 UTC) #18
akalin
moar comments http://codereview.chromium.org/10989063/diff/22004/sync/engine/build_commit_command.cc File sync/engine/build_commit_command.cc (right): http://codereview.chromium.org/10989063/diff/22004/sync/engine/build_commit_command.cc#newcode25 sync/engine/build_commit_command.cc:25: //Todo(vishwath) Remove this include after node positions ...
8 years, 2 months ago (2012-10-05 00:57:59 UTC) #19
rlarocque
I just skimmed through this responded to the comments that seemed the most interesting. I'll ...
8 years, 2 months ago (2012-10-05 01:10:50 UTC) #20
vishwath
I can make those changes, it seems like the biggest issues are the table locking ...
8 years, 2 months ago (2012-10-05 01:39:23 UTC) #21
akalin
[On Thu, Oct 4, 2012 at 6:39 PM, Vishwath Mohan <vishwath@google.com> wrote: > I can ...
8 years, 2 months ago (2012-10-05 02:45:33 UTC) #22
vishwath
The test I added takes the lazy route of constructing a v80 DB and migrating ...
8 years, 2 months ago (2012-10-05 18:34:49 UTC) #23
rlarocque
https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h File sync/internal_api/public/base/ordinal.h (right): https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h#newcode81 sync/internal_api/public/base/ordinal.h:81: // Creates a valid initial Ordinal. On 2012/10/05 18:34:49, ...
8 years, 2 months ago (2012-10-05 19:02:55 UTC) #24
vishwath
https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h File sync/internal_api/public/base/ordinal.h (right): https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h#newcode81 sync/internal_api/public/base/ordinal.h:81: // Creates a valid initial Ordinal. Entrykernels are also ...
8 years, 2 months ago (2012-10-05 21:05:48 UTC) #25
akalin
https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h File sync/internal_api/public/base/ordinal.h (right): https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h#newcode81 sync/internal_api/public/base/ordinal.h:81: // Creates a valid initial Ordinal. On 2012/10/05 21:05:48, ...
8 years, 2 months ago (2012-10-05 21:20:15 UTC) #26
rlarocque
https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h File sync/internal_api/public/base/ordinal.h (right): https://codereview.chromium.org/10989063/diff/22004/sync/internal_api/public/base/ordinal.h#newcode81 sync/internal_api/public/base/ordinal.h:81: // Creates a valid initial Ordinal. On 2012/10/05 21:20:15, ...
8 years, 2 months ago (2012-10-05 21:29:34 UTC) #27
vishwath
The default ctor is back to creating invalid Ordinals now. I've changed it so that ...
8 years, 2 months ago (2012-10-05 22:21:52 UTC) #28
akalin
Moar comments http://codereview.chromium.org/10989063/diff/34002/sync/engine/build_commit_command.cc File sync/engine/build_commit_command.cc (right): http://codereview.chromium.org/10989063/diff/34002/sync/engine/build_commit_command.cc#newcode25 sync/engine/build_commit_command.cc:25: //TODO(vishwath): Remove this include after node positions ...
8 years, 2 months ago (2012-10-05 22:40:27 UTC) #29
akalin
> EntryKernels have a lot more in common with C structs than C++ classes. It ...
8 years, 2 months ago (2012-10-05 22:42:05 UTC) #30
rlarocque
On 2012/10/05 22:42:05, akalin wrote: > > EntryKernels have a lot more in common with ...
8 years, 2 months ago (2012-10-05 23:02:07 UTC) #31
akalin
On 2012/10/05 23:02:07, rlarocque wrote: > > I'm not against moving towards a more C++-like ...
8 years, 2 months ago (2012-10-05 23:10:25 UTC) #32
vishwath
https://codereview.chromium.org/10989063/diff/34002/sync/engine/build_commit_command.cc File sync/engine/build_commit_command.cc (right): https://codereview.chromium.org/10989063/diff/34002/sync/engine/build_commit_command.cc#newcode25 sync/engine/build_commit_command.cc:25: //TODO(vishwath): Remove this include after node positions have On ...
8 years, 2 months ago (2012-10-08 20:17:49 UTC) #33
rlarocque
Some minor comments. Everything else looks OK. https://codereview.chromium.org/10989063/diff/48001/sync/syncable/directory_backing_store_unittest.cc File sync/syncable/directory_backing_store_unittest.cc (right): https://codereview.chromium.org/10989063/diff/48001/sync/syncable/directory_backing_store_unittest.cc#newcode2344 sync/syncable/directory_backing_store_unittest.cc:2344: TEST_F(DirectoryBackingStoreTest, InvalidOrdinalTriggersRedownload) ...
8 years, 2 months ago (2012-10-08 20:48:38 UTC) #34
akalin
LGTM after richard's and my nits https://codereview.chromium.org/10989063/diff/48001/sync/internal_api/public/base/ordinal.h File sync/internal_api/public/base/ordinal.h (right): https://codereview.chromium.org/10989063/diff/48001/sync/internal_api/public/base/ordinal.h#newcode81 sync/internal_api/public/base/ordinal.h:81: // Creates an ...
8 years, 2 months ago (2012-10-08 21:09:46 UTC) #35
vishwath
8 years, 2 months ago (2012-10-08 21:32:38 UTC) #36
rlarocque
LGTM. I'll leave it up to you whether or not you want to reconsider the ...
8 years, 2 months ago (2012-10-08 21:44:59 UTC) #37
akalin
https://codereview.chromium.org/10989063/diff/48003/sync/syncable/directory_backing_store_unittest.cc File sync/syncable/directory_backing_store_unittest.cc (right): https://codereview.chromium.org/10989063/diff/48003/sync/syncable/directory_backing_store_unittest.cc#newcode1854 sync/syncable/directory_backing_store_unittest.cc:1854: // Unlike the earlier versions, the rows for version ...
8 years, 2 months ago (2012-10-08 21:46:14 UTC) #38
vishwath
Yeah, I wasn't sure how to deal with null characters. I think there are ways ...
8 years, 2 months ago (2012-10-08 21:51:37 UTC) #39
akalin
couple more, but LGTM! https://codereview.chromium.org/10989063/diff/48003/sync/engine/syncer.cc File sync/engine/syncer.cc (right): https://codereview.chromium.org/10989063/diff/48003/sync/engine/syncer.cc#newcode30 sync/engine/syncer.cc:30: //TODO (vishwath): Remove this include ...
8 years, 2 months ago (2012-10-08 23:04:09 UTC) #40
rlarocque
On 2012/10/08 21:46:14, akalin wrote: > https://codereview.chromium.org/10989063/diff/48003/sync/syncable/directory_backing_store_unittest.cc > File sync/syncable/directory_backing_store_unittest.cc (right): > > https://codereview.chromium.org/10989063/diff/48003/sync/syncable/directory_backing_store_unittest.cc#newcode1854 > ...
8 years, 2 months ago (2012-10-08 23:21:07 UTC) #41
akalin
On Mon, Oct 8, 2012 at 4:21 PM, <rlarocque@chromium.org> wrote: > Only at the C++ ...
8 years, 2 months ago (2012-10-08 23:24:36 UTC) #42
rlarocque
On 2012/10/08 23:24:36, akalin wrote: > On Mon, Oct 8, 2012 at 4:21 PM, <mailto:rlarocque@chromium.org> ...
8 years, 2 months ago (2012-10-08 23:50:36 UTC) #43
vishwath
Does this look good to both of you?
8 years, 2 months ago (2012-10-09 00:17:20 UTC) #44
rlarocque
LGTM.
8 years, 2 months ago (2012-10-09 00:18:55 UTC) #45
akalin
lgtm!
8 years, 2 months ago (2012-10-09 00:19:21 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vishwath@google.com/10989063/55026
8 years, 2 months ago (2012-10-09 00:23:55 UTC) #47
commit-bot: I haz the power
Change committed as 160774
8 years, 2 months ago (2012-10-09 02:40:36 UTC) #48
vishwath
Its been a while since I've worked with manually managed memory, silly mistake on my ...
8 years, 2 months ago (2012-10-09 18:28:33 UTC) #49
vishwath
8 years, 2 months ago (2012-10-09 18:31:48 UTC) #50
Ignore the last patch, creating a separate issue for it instead.


On Tue, Oct 9, 2012 at 11:28 AM, <vishwath@google.com> wrote:

> Its been a while since I've worked with manually managed memory, silly
> mistake
> on my end. Should be fixed now.
>
>
https://codereview.chromium.**org/10989063/<https://codereview.chromium.org/1...
>

Powered by Google App Engine
This is Rietveld 408576698