On Wednesday, March 09, 2016 04:47:40 PM 'Dave Borowitz' via
Repo and Gerrit Discussion wrote:
...
> Shawn's reaction was basically, "sure, but it'd be easier
> to just use a local H2 database." By making the possibly
> overengineered proposal below, I'm not ruling out the
> easy hack.
H2 would not work (well) in a multi-master setup.
...
> This is a tricky one. It shouldn't go in the change meta
> DAG; this is metadata private to a user, and would be
> really noisy in the history
Agreed, because it really isn't about the change.
..
> This is a notes ref where the SHA-1s are patch set
> revisions.
>
> Contents of a file in the notes ref is like:
> # change,ps,path
> 1,1,path/to/bar.txt
> 1,1,path/to/foo.txt
> 2,3,"path/to/\nbaz.txt"
>
> Include change and patch set because the same SHA-1 can
> show up in multiple projects/branches.
Hmm, what if we decided that reviewed really is per sha?
Afterall, if you reviewed it as another file, even on another
PS on another change, have you not reviewed it? That would
be super cool in some ways, reviews on files that didn't
change would carry over!
..
> 1. Write latency and throughput will probably suck on
> googlesource.com. We already explicitly optimize write
> latency sucking in our current glue code. Possible
> optimization: batch a few seconds' worth of writes up in
> memory in process and trade off durability for fewer
> writes.
If we don't care about latency, then just do it in the
background, one at a time?
...
> 2. These will have giant amounts of history; I would
> probably opt for just squashing, we don't really need an
> audit log here.
>
> All that said, there's no alternative that doesn't involve
> one ref update per bit flip (modulo batching as mentioned
> above). The only alternative that doesn't involve writing
> a couple objects per bit flip is to store these all in
> refs but, remember, many thousands of bits per user. (A
> quick count shows about 7.5M bits for all of
> $large_internal_site.)
Crazy idea: create an All-Users subdirectory with one repo
per user? Then use one ref per sha?
Is there a shared embedded DB that we could use instead of
H2. I understand that sqlite is not java friendly, but it
would allow shared usage on NFS I think. Maybe move it to
H2, but make the backend pluggable (so that a MM solution
can be inserted easily)?
Is there a shared embedded DB that we could use instead of
H2. I understand that sqlite is not java friendly, but it
would allow shared usage on NFS I think. Maybe move it to
H2, but make the backend pluggable (so that a MM solution
can be inserted easily)?Since its very small per-user bit values that are quickly read and updated, a database is a better fit than a version controlled history storage system. So I am in favor of putting this into some other system.I think this should just be a small interface that behaves like a DynamicItem, similar to web session. A plugin should be able to replace the default implementation.
For a simple single server node that the admin just doesn't want to think much about, the default implementation can just be an H2 database on local disk. Similar to the persistent caches.A multimaster server might run a simple master-master MySQL replication system for this. Consistency isn't that important over this data, and its a very simple table, indexed in only one dimension. Google runs this table on top of a simple master-master Bigtable. The code to glue this table onto Bigtable is only a handful of lines of code; using MySQL vs. H2 should also be just a few lines. Less actually because we could reuse a fair chunk of that for both systems.
We don't even need gwtorm for that table. Its only got a few options. An insert method, a delete method, and 3 lookup functions. A generic base SQL class that the H2 and MySQL ones extend from is easy. And if that is just implementing a simple interface, other multi-master variations are possible.
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To me seems very similar to the user's session data, so ... (See inline)
On 16 Mar 2016, at 09:22, Dave Borowitz <dbor...@google.com> wrote:On Wed, Mar 16, 2016 at 8:23 AM, <luca.mi...@gmail.com> wrote:To me seems very similar to the user's session data, so ... (See inline)This actually sounds like you might prefer my option #3:-Remove the server-side component; persist reviewed bits in browser storage.
On 16 Mar 2016, at 09:22, Dave Borowitz <dbor...@google.com> wrote:On Wed, Mar 16, 2016 at 8:23 AM, <luca.mi...@gmail.com> wrote:To me seems very similar to the user's session data, so ... (See inline)This actually sounds like you might prefer my option #3:-Remove the server-side component; persist reviewed bits in browser storage.Why not? It could be one of the choices :-)If you accept in your company that this information can be easily stored in the browser local storage, you could implement a plugin for that.For other scenarios, H2 could be good as you don't have and you don't want to manage client state.It should be pluggable IMHO.
On Wednesday, March 16, 2016 03:15:05 PM Dave Borowitz
wrote:
> Still interested in hearing what Shawn and Martin think
> about the client-only option.
This whole feature stems from a google requirement I
believe? How would that requirement be impacted by such a
solution?
What is the motivation to doing it client side? To not have
to come up with a server side solution?
If so, are we just punting until the next similar problem?
It seems like a pluggable server solution would actually be easier to
implement and more full featured, so why consider the client
solution?
The value of off-loading the problem to the client is making it multi-master compatible out-of-the-box.
The drawback is: if you login with another browser or device, you don't see the data at all.
Is that acceptable? I believe for most cases, yes :-)
On 16 Mar 2016, at 17:18, Shawn Pearce <s...@google.com> wrote:On Wed, Mar 16, 2016 at 7:52 AM, Luca Milanesio <luca.mi...@gmail.com> wrote:The value of off-loading the problem to the client is making it multi-master compatible out-of-the-box.Multi-master is difficult enough out of the box that it isn't just "out of the box" yet. You need other things like web sessions and Git synchronized. By the time you get those setup you can also make sure the AccountPatchReviews is configured.
The drawback is: if you login with another browser or device, you don't see the data at all.That is a _huge_ drawback. I switch devices all of the time doing code reviews and I rely on the AccountPatchReviews flag. And coding the browser version is a horrible difference from pluggable server cases.
Is that acceptable? I believe for most cases, yes :-)No. No it is not.Sorry, but it is not.
Should this not be acceptable, having a pluggable backend persistence (H2 or whatever you want) would fit for purpose.