This is an archive of the discontinued Mercurial Phabricator instance.

cstore: generic uniondatapackstore
ClosedPublic

Authored by ms2316 on Aug 29 2017, 9:51 AM.
Tags
None
Subscribers
None

Details

Reviewers
durham
ryanmce
simonfar
Group Reviewers
Restricted Project
Commits
rFBHGX8cacf9669a0a: cstore: generic uniondatapackstore
Summary

Implementation of uniondatapackstore that can hold generic stores.
This diff doesn't support python data stores yet, but provides an abstraction
to the stores that can be used by uniondatapackstore.
DeltaChain and DeltaChainLink wrappers will allow to use C and python chains
and chain links.

Test Plan
  • Ensure that unit tests pass
  • Test on fbsource to ensure new code is executed by printfing to stdout
  • Ensure the code is built successfully on macOS

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ms2316 created this revision.Aug 29 2017, 9:51 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 29 2017, 9:51 AM
durham requested changes to this revision.Aug 29 2017, 8:34 PM

Overall looks really good. Tiny comments inline, but the only blocking things are:

Did you ensure that this builds on OSX?

Could you expand the test plan to also say how you ensured this code was running? Like you had printf's in the code and saw the output. This is a risky enough change that I just want to make sure it's actually being executed.

cstore/datastore.h
150

Seems this line should be deleted?

cstore/key.h
16 ↗(On Diff #1387)

Why is this required?

This revision now requires changes to proceed.Aug 29 2017, 8:34 PM
ms2316 marked 2 inline comments as done.Aug 29 2017, 8:53 PM

Thank you for the comment. I will test it a little bit more tomorrow to ensure there are no bugs on both a devserver and mac.

cstore/key.h
16 ↗(On Diff #1387)

Ooops. That's strange that I missed that. It is not required now, it was needed for my previous implementation of python data stores and it got here by accident.

ms2316 edited edge metadata.Aug 30 2017, 7:07 AM
ms2316 marked an inline comment as done.
ms2316 updated this revision to Diff 1431.

Removed unnecessary import and removed a line

ms2316 updated this revision to Diff 1437.Aug 30 2017, 10:36 AM

Rebased onto stable and added necessary includes so that build is successful on macOS

ms2316 updated this revision to Diff 1438.Aug 30 2017, 10:56 AM

Edited datastore.h file descriptions to match the standard

ms2316 edited the test plan for this revision. (Show Details)Aug 30 2017, 10:59 AM
ms2316 updated this revision to Diff 1439.

Updated testing plan

durham accepted this revision.Aug 30 2017, 12:07 PM
durham added inline comments.
cstore/datapackstore.h
23

alphabetical

cstore/datastore.h
110

I'm guessing freedeltachain doesn't actually free the delta_chain_t memory itself, since we're not passing in a pointer. So we probably need to free that up manually to avoid a memory leak.

This revision is now accepted and ready to land.Aug 30 2017, 12:07 PM
ms2316 updated this revision to Diff 1446.Aug 30 2017, 2:26 PM

DeltaChain costructor no longer accepts a pointer to the delta_chain_t. It accepts delta_chain_t by value and makes
a shallow copy. Therefore, it is responsible for memory management of that delta_chain_t.

ms2316 marked 2 inline comments as done.Aug 30 2017, 2:36 PM
ryanmce accepted this revision.Aug 31 2017, 11:13 AM

lgtmacro

This revision was automatically updated to reflect the committed changes.