Skip to content

Store shard metadata in S3, add a tailing facility - #5

Open
bickfordb wants to merge 9 commits into
masterfrom
shard-metadata
Open

Store shard metadata in S3, add a tailing facility#5
bickfordb wants to merge 9 commits into
masterfrom
shard-metadata

Conversation

@bickfordb

Copy link
Copy Markdown
  • Record shard positions in S3: This writes out a $keyPath.metadata file like {"shards": {"shard id": {"min_sequence_number": "X", "max_sequence_number": "Y"}}}
  • Add NewTailAt() function to tail records starting at a point
  • Factored some things out (e.g. S3 key paths into ArchiveKey)

Comment thread triton/uploader.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This name doesn't seem exactly right... the first argument is a Reader not a buffer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I renamed this to UploadData()

@rhettg

rhettg commented Dec 9, 2015

Copy link
Copy Markdown
Contributor

Who is supposed to call noteSequenceNumber()?

Comment thread triton/store.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do these actually need to be pointers to shardInfo?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think so because they are mutable

@bickfordb

Copy link
Copy Markdown
Author

Store now calls noteSequenceNumber()

@rhettg

rhettg commented Dec 10, 2015

Copy link
Copy Markdown
Contributor

Tests are failing

@rhettg

rhettg commented Dec 10, 2015

Copy link
Copy Markdown
Contributor

I think this is fine. Still seems like two totally independent designs with the Checkpointers and then this new interface, and they should be reconciled in some way.

But it's not really obvious to me right now how to do that.

👍

@rhettg

rhettg commented Dec 16, 2015

Copy link
Copy Markdown
Contributor

What's the story on this? Ready to go in?

@bickfordb

Copy link
Copy Markdown
Author

I'm ended up doing my tailing code in the Triton repo and based it off of
this branch. Still finishing that up and I'll update this review with that
code.

On Wed, Dec 16, 2015 at 2:23 PM, Rhett Garber notifications@github.com
wrote:

What's the story on this? Ready to go in?


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

@bickfordb bickfordb changed the title First stab at adding shard metadata Add shard metadata, tailing Dec 18, 2015
@bickfordb bickfordb changed the title Add shard metadata, tailing Store shard metadata in S3, add a tailing facility Dec 18, 2015
@bickfordb

Copy link
Copy Markdown
Author

Also, I think adding the (time->sequence number) metadata about each archive is different than checkpointing. It's just a way to skip through the stream faster

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a thought, but maybe you should just attempt to create archives for every key it finds, and let the DecodeArchiveKey figure out if it's a valid key to use or not.

Seems like it would be safer to allow unrecognizable keys to exist for future backwards compatibility reasons too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Seems reasonable

On Fri, Dec 18, 2015 at 3:05 PM, Rhett Garber notifications@github.com
wrote:

In triton/archive_repository.go
#5 (comment):

  • keys := []string{}
  • err = ar.s3Service.ListObjectsPages(&s3.ListObjectsInput{
  •   Bucket: aws.String(ar.bucket),
    
  •   Prefix: aws.String(keyPrefix),
    
  • }, func(output *s3.ListObjectsOutput, lastPage bool) (shouldContinue bool) {
  •   for _, object := range output.Contents {
    
  •       keys = append(keys, *object.Key)
    
  •   }
    
  •   return true
    
  • })
  • if err != nil {
  •   return
    
  • }
  • sort.Sort(sort.StringSlice(keys))
  • for _, key := range keys {
  •   if strings.HasSuffix(key, metadataSuffix) {
    

Just a thought, but maybe you should just attempt to create archives for
every key it finds, and let the DecodeArchiveKey figure out if it's a valid
key to use or not.

Seems like it would be safer to allow unrecognizable keys to exist for
future backwards compatibility reasons too?


Reply to this email directly or view it on GitHub
https://github.com/postmates/go-triton/pull/5/files#r48064339.

@rhettg

rhettg commented Dec 18, 2015

Copy link
Copy Markdown
Contributor

Can you add examples on using Tail to the Readme. That might also help inform whether the interfaces are similar enough to the existing api.

Brandon Bickford added 2 commits January 4, 2016 11:09
* Add ShardRecordReader interface
* Add shardReader that uses channels
* Update tail interface
@bickfordb

Copy link
Copy Markdown
Author

Updated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants