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
Towards safer migration #1378
Towards safer migration #1378
Conversation
…igration is always called
While this is absolutely the step in the right direction, I don't like the proposed API:
|
What would you suggest doing differently?
The code makes sure that
Even if an object is migrated to storage, it still stays registered with AGAS. Otherwise we will not be able to bring it back transparently later on. |
On Friday, February 20, 2015 12:37:04 Hartmut Kaiser wrote:
For the 1) case i'd suggest to implement something akin to scoped_lock.
That's true, however, it doesn't make sense to resolve the gid as long as it |
That's exactly what has been implemented (semantically). All exceptions will go through the futures returned from the separate steps of the operation. Once one of the futures has an exception it will bubble up through all remaining continuations, which will make sure that
Sorry, I don't understand what you mean. An object which was moved to storage (or to disk) still maintains its global id and stays registered with the AGAS instance where it was initially registered. If somebody resolves this global id while the object is on disk (not in main memory), this will return the global id of the storage component (as the object's 'locality') and an invalid local virtual address. IOW, storage components act like a special locality which puts those objects to disk which are migrated there. Migrating objects from this special locality resurrects the original object using its old global id. |
Am 20.02.2015 22:32 schrieb "Hartmut Kaiser" notifications@github.com:
You can't call on action on a component that's stored away, can you? As |
Currently, you can't call an action on a migrated object, that's what I said above - it would blow up. However, the plan is to transparently bring the object back if somebody invokes and action on it. For this to happen, more work is required, though. But I have the distinct feeling that I still not understand what you have in mind... |
Ok, one more try: Now, as far as I understand, before migration starts, one calls In my understanding, migration to disk does not form an exception to the semantic described above. The "medium" through which the component is transfered is some storage, and possibly network. As such, Having a special handling for the above described case sounds dangerous. How do you differentiate between program failure ( I hope that explains everything a little clearer. |
yes.
Ok, that explains your point. The misunderstanding however is, that you see the process of migrating an object to storage and back as a whole as 'migration'. The way I see it is that the storage is just another 'locality'. That means that migrating something to the storage itself comprises the migration step. Same would be true for migrating an object back from the storage locality. That means that in between the two migration operations the object 'lives' in the storage. The goal is to have a mechanism which transparently blurs the boundary between in-core and out-of-core memory, where objects are brought back to life transparently once needed. |
- don't use local AGAS cache for any object known to be migrated away from a locality. - send incoming parcel after migrated object.
Can we merge this now? |
On Friday, February 20, 2015 15:17:58 Hartmut Kaiser wrote:
Quite some misunderstanding indeed. I made all those implications from reading
I don't think the current implementation is suitable for that kind of
Why do they need to be not alive in the first place? By having them "not really |
@sithhell: Sorry, but I don't think the issues you're raising have any relation to the PR at hands. This PR is introducing 2 additional safeguards necessary to make migration more transparent in use (any kind of migration, even that which we already have for over a year). I also think I have not been able to properly explain the The |
On 02/25/2015 05:20 AM, Hartmut Kaiser wrote:
Right, this PR adds the safe guard and implements the safe guard for the
Ok, let's recap how the safeguard works and what it should protect from:
I hope I got those points correct. The implications I derive from this Now here comes the, IMHO, problematic part: Those derived semantics are |
All of this is correct.
Ok, I see your point. I will make sure that any object in storage is transparently brought back when accessed. This PR however is all about the two safeguarding mechanisms, not about the migration to storage. I take it that you have no objections to the safeguarding code as it is.
FWIW, you always have to serialize an object in order to put it to disk. |
That's not entirely true. One could imagine an allocator that uses a memory mapped file to store the necessary data (similar to |
No objection to the general safe guarding mechanism. The only objection is the way it is used for |
[Feb 25th, 08:17] heller: hkaiser: gtg now ... I'm fine with merging the PR ... but please create issue that explains what needs to be done so that migrate_to_storage/migrate_from_storage works again as expected |
This PR adds a new AGAS API:
hpx::agas::begin_migration
andhpx::agas::end_migration
. These functions make sure that no address resolution proceeds while a migration operation is in flight. All address resolution requests will be deferred untilend_migration
is called.This PR also adapts the existing API functions
hpx::components::migrate
,hpx::components::migrate_to_storage
, andhpx::components::migrate_from_storage
to use the new AGAS API.Overall, this is the first step to make the process of migrating objects transparent to the user (see #559).