Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocking co::Object::commit #116

Closed
eile opened this issue Apr 24, 2012 · 5 comments
Closed

Blocking co::Object::commit #116

eile opened this issue Apr 24, 2012 · 5 comments
Assignees
Labels
Milestone

Comments

@eile
Copy link
Member

eile commented Apr 24, 2012

Needed by @tribal-tec for codash: Implement a way to configure per master or per slave object how many versions might be queued up before a commit blocks.

@ghost ghost assigned eile Apr 24, 2012
@eile
Copy link
Member Author

eile commented Apr 24, 2012

Issue 1: Per master or per slave?

Resolved: per slave seems to give more flexibility and cleaner

Per master:

  • Owner decides
  • Master can request ack with stream
  • Potentially simpler impl

Per slave:

  • different receivers can have different queuing strategies
  • It's the slave's memory being used

@eile
Copy link
Member Author

eile commented Apr 24, 2012

Issue 2: Runtime-changeable?

Resolved: no.

For simplicity and memory footprint will go with a overridable method to configure max queue size. If the return value changes at runtime the behavior is undefined for now.

@eile
Copy link
Member Author

eile commented Apr 24, 2012

API

virtual uint64_t co::Object::getMaxVersions() const { return std::numeric_limits< uint64_t >::max(); }

@eile
Copy link
Member Author

eile commented Apr 24, 2012

Issue 3: Also for slave object commits?

Not for now. Requires a completely different implementation, and is not needed yet.

@eile
Copy link
Member Author

eile commented Apr 24, 2012

Implementation

  • Master CM has per-slave 'maxVersion', defaults to uint64_t::max
  • Slave CM queries getMaxVersions() after each sync
    • sends version_ack with synced+maxVersions to master
    • master updates per-slave maxVersion to received value, updated global maxVersion monitor
  • Master commit monitors maxVersion.waitGE( current+1 ) before committing

eile added a commit that referenced this issue Apr 25, 2012
@eile eile closed this as completed in 662db9d Apr 25, 2012
eile added a commit that referenced this issue Apr 25, 2012
eile added a commit that referenced this issue Apr 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant