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

Issue 1550903002: impl/memory: Fix time serialization encoding. (Closed)

Created:
4 years, 12 months ago by dnj
Modified:
4 years, 11 months ago
Reviewers:
Vadim Sh., iannucci
CC:
chromium-reviews, infra-reviews+luci-gae_chromium.org
Base URL:
https://github.com/luci/gae@master
Target Ref:
refs/heads/master
Project:
luci-gae
Visibility:
Public.

Description

impl/memory: Fix time serialization encoding. In a PropertyMap, time is serialized as an integer type. However, for queries, time is serialized as a time type. This causes all queries on time fields to select any encoded time properties, since PTTime > PTInt. This patch causes queries to serialize PTTime properties as PTInts to match the indexes. Fixes #34. Committed: https://github.com/luci/gae/commit/21185c790cd5f81b3a9378109e23aab22bd99356

Patch Set 1 #

Total comments: 3

Patch Set 2 : Convert when building the query, not serializing in general. #

Total comments: 4

Patch Set 3 : Move logic to serialize, add blobstore.Key support. #

Total comments: 2

Patch Set 4 : Support PTBytes type, found the "ForIndex" method. #

Total comments: 1

Patch Set 5 : Implement zero-copy ForIndex, compare, and byte/string equivalence. #

Patch Set 6 : Deduplicate time/int conversion logic. #

Total comments: 10

Patch Set 7 : Cleanup. #

Total comments: 2

Patch Set 8 : Fixed missing value conversion. #

Patch Set 9 : Store PTTime as time.Time internally, ForIndex -> GetIndexTypeAndValue. #

Total comments: 4

Patch Set 10 : Cleanups. #

Patch Set 11 : Comments, tune-up. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+463 lines, -191 lines) Patch
M impl/memory/datastore_index_test.go View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M impl/memory/datastore_query.go View 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M impl/memory/datastore_query_execution_test.go View 1 2 3 4 chunks +80 lines, -2 lines 0 comments Download
M service/datastore/key.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M service/datastore/pls_impl.go View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M service/datastore/properties.go View 1 2 3 4 5 6 7 8 9 10 14 chunks +266 lines, -115 lines 0 comments Download
M service/datastore/properties_test.go View 1 2 3 4 5 6 7 8 2 chunks +25 lines, -0 lines 0 comments Download
M service/datastore/serialize/serialize.go View 1 2 3 4 5 6 7 8 9 10 5 chunks +77 lines, -58 lines 0 comments Download
M service/datastore/serialize/serialize_test.go View 1 2 3 4 5 3 chunks +5 lines, -8 lines 0 comments Download

Messages

Total messages: 33 (7 generated)
dnj
PTAL. I'm not sure if this is the best fix, but I think it might ...
4 years, 12 months ago (2015-12-29 07:23:16 UTC) #2
dnj
https://chromiumcodereview.appspot.com/1550903002/diff/1/service/datastore/serialize/serialize.go File service/datastore/serialize/serialize.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/1/service/datastore/serialize/serialize.go#newcode233 service/datastore/serialize/serialize.go:233: case ds.PTTime: I made this a switch statement in ...
4 years, 11 months ago (2015-12-29 16:48:09 UTC) #3
iannucci
On 2015/12/29 at 16:48:09, dnj wrote: > https://chromiumcodereview.appspot.com/1550903002/diff/1/service/datastore/serialize/serialize.go > File service/datastore/serialize/serialize.go (right): > > https://chromiumcodereview.appspot.com/1550903002/diff/1/service/datastore/serialize/serialize.go#newcode233 ...
4 years, 11 months ago (2015-12-29 18:28:56 UTC) #4
iannucci
https://chromiumcodereview.appspot.com/1550903002/diff/1/impl/memory/datastore_query_execution_test.go File impl/memory/datastore_query_execution_test.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/1/impl/memory/datastore_query_execution_test.go#newcode408 impl/memory/datastore_query_execution_test.go:408: indx("Kind!", "Date"), I think ! is shorthand for ancestor ...
4 years, 11 months ago (2015-12-29 18:29:20 UTC) #5
dnj
Updated, PTAL
4 years, 11 months ago (2015-12-29 19:28:14 UTC) #7
iannucci
looks much better, but I think there's still a bug for equalities, and the byte-string-type ...
4 years, 11 months ago (2015-12-29 19:53:46 UTC) #8
dnj
Added blobstore.Key, restructured a tad. PTAL. https://chromiumcodereview.appspot.com/1550903002/diff/20001/impl/memory/datastore_query.go File impl/memory/datastore_query.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/20001/impl/memory/datastore_query.go#newcode110 impl/memory/datastore_query.go:110: // them as ...
4 years, 11 months ago (2015-12-29 21:40:47 UTC) #10
iannucci
https://chromiumcodereview.appspot.com/1550903002/diff/60001/service/datastore/serialize/serialize.go File service/datastore/serialize/serialize.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/60001/service/datastore/serialize/serialize.go#newcode291 service/datastore/serialize/serialize.go:291: // - PTBlobKey is converted to a string. and ...
4 years, 11 months ago (2015-12-29 21:41:49 UTC) #11
dnj
Much nicer now.
4 years, 11 months ago (2015-12-29 23:04:16 UTC) #12
iannucci
On 2015/12/29 at 23:04:16, dnj wrote: > Much nicer now. lgtm, though if we could ...
4 years, 11 months ago (2015-12-30 23:12:17 UTC) #13
iannucci
https://chromiumcodereview.appspot.com/1550903002/diff/80001/service/datastore/serialize/serialize.go File service/datastore/serialize/serialize.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/80001/service/datastore/serialize/serialize.go#newcode245 service/datastore/serialize/serialize.go:245: p = p.ForIndex() I think this may end up ...
4 years, 11 months ago (2015-12-30 23:12:24 UTC) #14
iannucci
Haha cool :P WDYT about the suggestion re: Value() below? I don't think it's actually ...
4 years, 11 months ago (2015-12-31 23:22:34 UTC) #16
dnj
https://chromiumcodereview.appspot.com/1550903002/diff/140001/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/140001/service/datastore/properties.go#newcode181 service/datastore/properties.go:181: value interface{} On 2015/12/31 23:22:34, iannucci (OOO till Jan ...
4 years, 11 months ago (2016-01-01 17:43:30 UTC) #17
iannucci
https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go#newcode411 service/datastore/properties.go:411: return PTString, p.value.(byteSequence).Value() but this is still wrong... if ...
4 years, 11 months ago (2016-01-02 04:11:07 UTC) #18
iannucci
On 2016/01/02 at 04:11:07, iannucci (OOO till Jan 4) wrote: > https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go > File service/datastore/properties.go ...
4 years, 11 months ago (2016-01-02 04:38:29 UTC) #19
dnj
https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go#newcode411 service/datastore/properties.go:411: return PTString, p.value.(byteSequence).Value() On 2016/01/02 04:11:07, iannucci (OOO till ...
4 years, 11 months ago (2016-01-02 06:39:46 UTC) #20
iannucci
On 2016/01/02 at 06:39:46, dnj wrote: > https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go > File service/datastore/properties.go (right): > > https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go#newcode411 ...
4 years, 11 months ago (2016-01-02 07:18:14 UTC) #21
dnj
> https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go#newcode411 > > service/datastore/properties.go:411: return PTString, > p.value.(byteSequence).Value() > > On 2016/01/02 04:11:07, iannucci ...
4 years, 11 months ago (2016-01-02 17:58:10 UTC) #22
iannucci
On 2016/01/02 at 17:58:10, dnj wrote: > > https://chromiumcodereview.appspot.com/1550903002/diff/160001/service/datastore/properties.go#newcode411 > > > service/datastore/properties.go:411: return PTString, ...
4 years, 11 months ago (2016-01-03 09:39:05 UTC) #23
dnj
> > That's the main reason I changed ForIndex from returning a Property to just ...
4 years, 11 months ago (2016-01-03 16:13:13 UTC) #24
dnj
Updated as per discussion, PTAL!
4 years, 11 months ago (2016-01-04 20:07:26 UTC) #25
dnj
Updated as per discussion, PTAL!
4 years, 11 months ago (2016-01-04 20:07:26 UTC) #26
iannucci
lgtm https://chromiumcodereview.appspot.com/1550903002/diff/200001/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/200001/service/datastore/properties.go#newcode180 service/datastore/properties.go:180: // in its original original value via Value(). ...
4 years, 11 months ago (2016-01-05 02:02:58 UTC) #27
dnj
https://chromiumcodereview.appspot.com/1550903002/diff/200001/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/1550903002/diff/200001/service/datastore/properties.go#newcode180 service/datastore/properties.go:180: // in its original original value via Value(). On ...
4 years, 11 months ago (2016-01-05 02:46:17 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1550903002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1550903002/240001
4 years, 11 months ago (2016-01-05 03:04:36 UTC) #31
commit-bot: I haz the power
4 years, 11 months ago (2016-01-05 03:07:29 UTC) #33
Message was sent while issue was closed.
Committed patchset #11 (id:240001) as
https://github.com/luci/gae/commit/21185c790cd5f81b3a9378109e23aab22bd99356

Powered by Google App Engine
This is Rietveld 408576698