git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Ronnie Sahlberg <sahlberg@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Pluggable backends for refs,wip
Date: Thu, 07 Aug 2014 05:57:17 -0700	[thread overview]
Message-ID: <53E377AD.606@alum.mit.edu> (raw)
In-Reply-To: <CAL=YDWk5C+bQS76_+jx1BSYSxecCxaS95RG181ecbJBLCNWLkQ@mail.gmail.com>

On 08/05/2014 02:40 PM, Ronnie Sahlberg wrote:
> Please see
> https://github.com/rsahlberg/git/tree/backend-struct-db-2
> for an example of a pluggable backend for refs storage.
> 
> This series contain changes to make it possible to add new backends
> for handling/storage of refs and implements one new backend :
> refs-be-be.c .
> 
> This new backend offloads the actual refs handling to a small database
> daemon with which ita talks via a very simple rpc protocol. That
> daemon in turn then connects to the datastore and read/writes the
> values to it.
> [...]

Ronnie,

This is awesome!  Congratulations on your progress.

I'm still on vacation and haven't yet looked at the code.  I will be
back next week and hope to find time to check it out, and also to do
some more review of the code that you have already submitted to git core.


Have you thought about how to test alternate reference backends?  This
will be very important to getting one or more of them accepted into git
core (not to mention giving people confidence to actually *use* them!)

It seems to me that a few steps are needed:

* Each backend would need a suite of backend-aware tests that verify
proper operation *within* the backend.  These tests would mostly use
low-level plumbing commands like update-refs to create/modify/delete
references, and would be allowed to grub around in the filesystem, talk
directly with the database, etc. to make sure that the commands have the
correct effects.  For example, for the traditional filesystem backend,
these tests would be the ones to check that creating a reference causes
a file to spring into existence under $GIT_DIR/refs.

The tests for pack-refs, and all tests that care about the distinction
between packed and loose refs, would become part of the backend-aware
tests for the filesystem backend.

All of the backend-aware tests should be run every time the test suite
is run (provided, of course, that the correct prerequisites are
available, and subject to being turned off manually).

* The rest of the test suite has to be made backend-agnostic.  For
example, such tests should *not* be allowed to look under $GIT_DIR for
the existence/absence of loose reference files [1] but would rather have
to inquire about references via git commands.

* It should be possible for the developer to choose easily which
reference backend to use when running the agnostic part of the test
suite.  The chosen backend should be used to run *all* backend-agnostic
tests.

A database-backed backend might even want to be testable in two modes:
one with the DB daemon running constantly, and one where the daemon is
stopped and started between each pair of Git commands.

So after the changes, a single run of the test suite should run the
backend-aware tests for *all* known backends followed by the
backend-agnostic tests for a single selected backend.

Michael

[1] When I was working on my quagga-reference spike [2] I found that a
lot of the test suite uses knowledge about how references and reflogs
are stored by the filesystem backend and just grabs at the files rather
than accessing the references using git commands.  It will take some
work to clean this up.

[2] http://thread.gmane.org/gmane.comp.version-control.git/243726

-- 
Michael Haggerty
mhagger@alum.mit.edu

  parent reply	other threads:[~2014-08-07 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 21:40 Pluggable backends for refs,wip Ronnie Sahlberg
2014-08-05 21:56 ` Nico Williams
2014-08-05 22:23   ` Ronnie Sahlberg
2014-08-05 22:28     ` Nico Williams
2014-08-07 12:57 ` Michael Haggerty [this message]
2014-08-08 15:53   ` Ronnie Sahlberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53E377AD.606@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=sahlberg@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).