Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

cas: add an ACIInfo table #393

Merged
merged 1 commit into from
Feb 20, 2015
Merged

cas: add an ACIInfo table #393

merged 1 commit into from
Feb 20, 2015

Conversation

sgotti
Copy link
Contributor

@sgotti sgotti commented Jan 19, 2015

Last commit is the interesting one. It needs the db implementation provided in #361 and is based over #392. IMHO this db based implementation is really cleaner and better that the hackish diskv based ones proposed in #352 and #353.

The ACIInfo table saves informations on the ACIs. The saved informations are:

  • BlobKey is the key in the blob and imageManifest store of the related ACI file.
  • AppName is the app name provided by the ACI.
  • ImportTime is the time this ACI was imported in the store
  • Latest defines if the ACI was imported using the latest pattern (no version
    label provided on ACI discovery)

About the latest pattern please see (and comment) on appc/spec#73.

@iaguis
Copy link
Member

iaguis commented Feb 18, 2015

Needs rebase/update.

@sgotti
Copy link
Contributor Author

sgotti commented Feb 18, 2015

@iaguis @jonboulle Updated.

Just a question, as rocket is in development, does this patch needs a migrate script (to create the new tables on an already populated db? (if someone used rkt between #361 and this)). Plus the acis already in the db won't have an entry in the table (and this can bring some problems when GetACI will be used).

I usually clean my local cas data when I see strange problems/errors (in past this happened some times).

For the final user, should it be warned, at release time, of the need to clean its cas?

There are other various cases:

@jonboulle
Copy link
Contributor

@sgotti I am not concerned about migration yet as we are still getting the DB in place; obviously it will become a requirement at a later point once we have a stable on-disk format, but for now I am happy to just advise people to clear their cas.

)

// ACIInfo is used to store informations about an ACI
// BlobKey is the key in the blob and imageManifest store of the related ACI file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to just inline these docstrings, for example - http://golang.org/pkg/net/http/#Response

@sgotti
Copy link
Contributor Author

sgotti commented Feb 19, 2015

@jonboulle thanks. I hope to have fixed all your comments. In the meantime I expanded the tests and added an index on appname as I think it will be one of the most used search criteria.

// was imported in the store. Latest defines if the ACI was imported using the
// latest pattern (no version label was provided on ACI discovery)
type ACIInfo struct {
BlobKey string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, could you please update this? what I meant was

// ACIInfo is used to store information about an ACI
type ACIInfo struct {
    // BlobKey is the key in the ...
    BlobKey string
    // AppName is the ...
    AppName string
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Sorry... Now I overlooked you explanation.

@iaguis
Copy link
Member

iaguis commented Feb 20, 2015

LGTM

The ACIInfo table save informations on the ACIs. The saved informations are:

* BlobKey is the key in the blob and imageManifest store of the related ACI file.
* AppName is the app name provided by the ACI.
* ImportTime is the time this ACI was imported in the store
* Latest defines if the ACI was imported using the latest pattern (no version
label provided on ACI discovery)
jonboulle added a commit that referenced this pull request Feb 20, 2015
cas: add an ACIInfo table
@jonboulle jonboulle merged commit 3252aff into rkt:master Feb 20, 2015
@alban
Copy link
Member

alban commented Feb 23, 2015

When testing with this patch merged, I had this error:

Error finding stage1 image "/home/alban/go/src/github.com/coreos/rocket/bin/stage1.aci": /home/alban/go/src/github.com/coreos/rocket/bin/stage1.aci:
error writing ACI Info: DELETE FROM: table aciinfo does not exist

Deleting /var/lib/rkt/cas fixed the issue.

@jonboulle
Copy link
Contributor

Yes that is a known issue, we should make sure we note it in the release
notes for the next release
Am 23.02.2015 17:08 schrieb "Alban" notifications@github.com:

When testing with this patch merged, I had this error:

Error finding stage1 image "/home/alban/go/src/github.com/coreos/rocket/bin/stage1.aci": /home/alban/go/src/github.com/coreos/rocket/bin/stage1.aci:
error writing ACI Info: DELETE FROM: table aciinfo does not exist

Deleting /var/lib/rkt/cas fixed the issue.


Reply to this email directly or view it on GitHub
#393 (comment).

@sgotti sgotti deleted the aciinfodb branch May 24, 2015 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants