The Explore of Unified Management Ideas of the placement group on a kind of object storage device
Technical field
The present invention relates to a kind of object storage device technical field, the Explore of Unified Management Ideas of the placement group specifically on a kind of object storage device.
Background technology
In order to reduce the integral operation amount of object storage system, improve system performance.In the process setting up mapping relations between storage object and object storage device, introduce a middle layer between storage object and object storage device, be referred to as placement group.Placement group is a logical concept, and the storage object belonging to a placement group will adopt same placement rule, namely be distributed on identical object storage device.
Object storage device (Object-Based Storage Device, OSD) be a smart machine being used for storage object, there are independently storage medium, processor, internal memory and network interface card etc., can manage independently himself safe, store and network service.It has been generally acknowledged that an object storage device is exactly a complete object storage device or storage server.
In the object storage system based on two-stage Hash, Hash and consistance Hash twice hash algorithm is adopted to realize the location of object.Namely for given object, first determined the placement group at place by the Hash result of its object oriented, and then use consistance Hash to determine the OSD at placement group place to placement group.This method can reduce the operand in subject positioning process, particularly when memory node delays machine, only needs the consistance Hash result recalculating placement group can find the OSD at place.
In sum, the storage object in object storage system on OSD belongs to the different placement group on OSD respectively.In units of placement group, the storage object on OSD is processed, the process of object on OSD can be realized efficiently.The efficiency of management of the upper placement group of OSD and correctness, be easy to the partial function of bottleneck, the even influential system becoming system.
Summary of the invention
Technical assignment of the present invention is to provide the Explore of Unified Management Ideas of the placement group on a kind of object storage device; Use the placement group set with timestamp, realize the correct of the placement group on object storage device and effectively manage.
Technical assignment of the present invention realizes in the following manner, the Explore of Unified Management Ideas of the placement group on a kind of object storage device, uses the method with the placement group set of timestamp to realize carrying out correctly effectively managing to the placement group on object storage device; When OSD starts, the placement group belonged on this OSD is stamped timestamp successively and is inserted in set; When needing the object that OSD stores to process, travel through the placement group in set successively according to time sequencing; Take out a placement group, erasing from set after having processed, then stamp new timestamp and reinsert in set; The increase of placement group or minimizing, call placement group registration and unregistration method respectively and realize dynamic insertion or erasing.
Placement group is registered: when OSD initialization or newly-increased placement group, need placement group to be inserted in set according to timestamp; Placement group is nullified: the placement group processed is erasing from set; Placement group iteration: process the placement group in set according to the order of timestamp successively, the placement group processed needs erasing from set, after then stamping new timestamp, reinserts in set.
(1), the code of structure and set is as follows:
struct Flusher{;
Utime_t flush_reg_stamp; // hour of log-on stabs;
}flusher;
The set< pair< time, placement group > > last_flush_pg;
(2), placement group register method, Implementation of pseudocode is as follows:
void reg_last_pg_flush(spg_t pgid, utime_t t) {;
last_flush_pg.insert(pair<utime_t,spg_t>(t, pgid));
};
(3), placement group cancellation method, Implementation of pseudocode is as follows:
void unreg_last_pg_flush(spg_t pgid, utime_t t) {;
pair<utime_t,spg_t> p(t, pgid);
set<pair<utime_t,spg_t> >::iterator it = last_flush_pg.find(p);
last_flush_pg.erase(it);
}。
The Explore of Unified Management Ideas of the placement group on a kind of object storage device of the present invention, beneficial effect is: the unified management realizing placement group on object storage device, can realize the process of object on OSD efficiently.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is further described.
Accompanying drawing 1 is the placement group traversal schematic diagram of the Explore of Unified Management Ideas of placement group on a kind of object storage device.
Embodiment
Be described in detail below with reference to Figure of description and the Explore of Unified Management Ideas of specific embodiment to the placement group on a kind of object storage device of the present invention.
Embodiment 1:
The Explore of Unified Management Ideas of the placement group on a kind of object storage device of the present invention, uses the method with the placement group set of timestamp to realize carrying out correctly effectively managing to the placement group on object storage device; When OSD starts, the placement group belonged on this OSD is stamped timestamp successively and is inserted in set; When needing the object that OSD stores to process, travel through the placement group in set successively according to time sequencing; Take out a placement group, erasing from set after having processed, then stamp new timestamp and reinsert in set; The increase of placement group or minimizing, call placement group registration and unregistration method respectively and realize dynamic insertion or erasing.
Embodiment 2:
The Explore of Unified Management Ideas of the placement group on a kind of object storage device of the present invention, uses the method with the placement group set of timestamp to realize carrying out correctly effectively managing to the placement group on object storage device; When OSD starts, the placement group belonged on this OSD is stamped timestamp successively and is inserted in set; When needing the object that OSD stores to process, travel through the placement group in set successively according to time sequencing; Take out a placement group, erasing from set after having processed, then stamp new timestamp and reinsert in set; The increase of placement group or minimizing, call placement group registration and unregistration method respectively and realize dynamic insertion or erasing.
Placement group is registered: when OSD initialization or newly-increased placement group, need placement group to be inserted in set according to timestamp; Placement group is nullified: the placement group processed is erasing from set; Placement group iteration: process the placement group in set according to the order of timestamp successively, the placement group processed needs erasing from set, after then stamping new timestamp, reinserts in set.
(1), the code of structure and set is as follows:
struct Flusher{;
Utime_t flush_reg_stamp; // hour of log-on stabs;
}flusher;
The set< pair< time, placement group > > last_flush_pg;
(2), placement group register method, Implementation of pseudocode is as follows:
void reg_last_pg_flush(spg_t pgid, utime_t t) {;
last_flush_pg.insert(pair<utime_t,spg_t>(t, pgid));
};
(3), placement group cancellation method, Implementation of pseudocode is as follows:
void unreg_last_pg_flush(spg_t pgid, utime_t t) {;
pair<utime_t,spg_t> p(t, pgid);
set<pair<utime_t,spg_t> >::iterator it = last_flush_pg.find(p);
last_flush_pg.erase(it);
}。
By embodiment above, described those skilled in the art can be easy to realize the present invention.But should be appreciated that the present invention is not limited to above-mentioned embodiment.On the basis of disclosed embodiment, described those skilled in the art can the different technical characteristic of combination in any, thus realizes different technical schemes.