A distributed computing environment may include multiple autonomous or semi-autonomous computing devices (e.g., servers, computers, etc.) that communicate with one another through a computer network. The computing device in the distributed computing environment may each have a local memory, and may communicate by passing messages.
A device may receive information that identifies a data item and an operation to perform on the data item. The device may store a first sequence identifier, a data item reference that references the data item, and an operation reference that references the operation. The first sequence identifier may reference the data item and operation references, and may indicate an order in which the first sequence identifier is stored. The device may store the data item in a memory location, may store an identification of the memory location, may remove a reference to the data item by a previous sequence identifier, and/or may add the data item, may modify the data item, or may delete the data item depending on whether the operation is an add operation, a modify operation, or a delete operation. The device may transmit, to a slave device, the first sequence identifier, the data item reference, and the operation reference.
The following detailed description of example implementations refers to the accompanying drawings. The same reference numbers in different drawings may identify the same or similar elements.
In a distributed computing environment where each computer has a local memory, it may be desirable to synchronize the computers so that each local memory is updated with current information. For example, computers in a distributed computing environment may act as nodes in a network, such as a telecommunications network, and each node may be responsible for routing traffic through the network. In order to route traffic efficiently, each node should be updated with current network information, such as available bandwidth at other nodes, available bandwidth on links (e.g., optical fibers) that connect nodes, and other routing information.
A distributed computing environment may include master devices responsible for receiving current information, storing the current information, and communicating the current information to slave devices. Implementations described herein may assist in synchronizing devices in a distributed computing environment (such as master devices and slave devices) so that a local memory of each device stores current information.
As illustrated in
In some embodiments, the master device may push a data item update to slave devices that store the data set to which the data item update belongs. For example, an update to a data item included in data set A may be pushed to slave device N, but not to slave device 1. As used herein, “pushing” information may refer to sending information to a slave device, from the master device, without receiving a request for the information from the slave device.
Additionally, or alternatively, a slave device may identify a data item that is missing from a data set stored on the slave device. The slave device may pull the missing data item from the master device. As used herein, “pulling” information may refer to sending information to a slave device, from the master device, after receiving a request for the information from the slave device.
Master device 210 may include one or more computation and communication devices, such as a server. In some implementations, master device 210 may be a computing device included in a distributed computing environment, such as a computing node, a hub, a bridge, a gateway, a router, a modem, a switch, a firewall, a server, an optical add/drop multiplexer (“OADM”), or another type of device in a distributed computing environment. In some implementations, master device 210 may process, route, and/or transfer traffic through a distributed computing environment. Additionally, or alternatively, master device 210 may receive information (e.g., information regarding the distributed computing environment), may store the information, and may communicate the information to slave devices 220 via network 230. Master device 220 may receive the information from a user, an application, and/or another device.
Slave device 220 may include a computation and communication device included in a distributed computing environment, such as a computing node, a hub, a bridge, a gateway, a router, a modem, a switch, a firewall, a server, an optical add/drop multiplexer (“OADM”), or another type of device included in a distributed computing environment. In some implementations, slave device 220 may process, route, and/or transfer traffic through a distributed computing environment. Additionally, or alternatively, slave device 220 may request information from master device 210 (e.g., via network 230), and may receive a response to the request from master device 210 (e.g., via network 230). In some implementations, slave device 220 may include one or more master devices 210. In other words, slave device 220 may be capable of performing the functions of master device 210 for other slave devices 220.
Network 230 may include one or more wired and/or wireless networks. For example, network 230 may include a cellular network, a radio access network, a public land mobile network (“PLMN”), a local area network (“LAN”), a wide area network (“WAN”), a metropolitan area network (“MAN”), a telephone network (e.g., the Public Switched Telephone Network (“PSTN”)), an ad hoc network, an intranet, the Internet, a fiber optic-based network, and/or a combination of these or other types of networks.
The number of devices and/or networks illustrated in
Bus 310 may include a path that permits communication among the components of device 300. Processor 320 may include a processor, a microprocessor, and/or any processing logic (e.g., a field-programmable gate array (“FPGA”), an application-specific integrated circuit (“ASIC”), etc.) that interprets and/or executes instructions. In some implementations, processor 320 may include one or more processor cores. Memory 330 may include a random access memory (“RAM”), a read only memory (“ROM”), and/or any type of dynamic or static storage device (e.g., a flash, magnetic, or optical memory) that stores information and/or instructions for use by processor 320.
Input component 340 may include any mechanism that permits a user to input information to device 300 (e.g., a keyboard, a keypad, a mouse, a button, a switch, etc.). Output component 350 may include any mechanism that outputs information from device 300 (e.g., a display, a speaker, one or more light-emitting diodes (“LEDs”), etc.).
Communication interface 360 may include any transceiver-like mechanism, such as a transceiver and/or a separate receiver and transmitter, that enables device 300 to communicate with other devices and/or systems, such as via a wired connection, a wireless connection, or a combination of wired and wireless connections. For example, communication interface 360 may include a mechanism for communicating with another device and/or system via a network. Additionally, or alternatively, communication interface 360 may include a logical component with input and output ports, input and output systems, and/or other input and output components that facilitate the transmission of data to and/or from another device, such as an Ethernet interface, an optical interface, a coaxial interface, an infrared interface, a radio frequency (“RF”) interface, a universal serial bus (“USB”) interface, or the like.
Device 300 may perform various operations described herein. Device 300 may perform these operations in response to processor 320 executing software instructions included in a computer-readable medium, such as memory 330. A computer-readable medium may be defined as a non-transitory memory device. A memory device may include space within a single storage device or space spread across multiple storage devices.
Software instructions may be read into memory 330 from another computer-readable medium or from another device via communication interface 360. When executed, software instructions stored in memory 330 may cause processor 320 to perform one or more processes that are described herein. Additionally, or alternatively, hardwired circuitry may be used in place of or in combination with software instructions to perform one or more processes described herein. Thus, implementations described herein are not limited to any specific combination of hardware circuitry and software.
The number of components illustrated in
Data set registration table 410 may perform operations associated with creating and managing data sets. In some implementations, data set registration table 410 may register a data set by storing the data set in memory and assigning a data set identifier (e.g., a number, an integer, a letter, etc.) to the data set. For example, data set registration table 410 may receive a registration request for a data set to be stored on master device 210 and to be replicated on slave devices 220, and may register the data set based on the registration request. Data set registration table 410 may also unregister a data set by removing the data set from memory. Additionally, or alternatively, data set registration table 410 may update a data set by adding, modifying, or deleting a data item 440 in the data set. In some implementations, data set registration table 410 may enable or disable access to a data set. For example, data set registration table 410 may disable communication of information stored in a data set to slave device 220 when the data set is being updated (e.g., when a data item is being added to, modified, or deleted from the data set). In some implementations, data set registration table 410 may receive information identifying a command, and may manage a data set based on the command.
Messaging layer 420 may perform operations associated with communicating with slave device 220. For example, messaging layer 420 may enable slave device 220 to be aware of master device 210, and to communicate with master device 210. In some implementations, messaging layer 420 may push data items to slave device 220 via multicasting. For example, each slave device that stores a particular set of data sets may be registered with a particular multicast address. Master device 210 may publish updates to the particular set of data sets using the particular multicast address as a destination for the updates. Additionally, or alternatively, messaging layer 420 may receive a pull request from a slave device 220, and may send a data item to slave device 220 via a unicast address in response to the pull request.
Data set module 430 may perform operations associated with maintaining and publishing data sets. In some implementations, data set module 430 may store data items 440. Data item 440 may include content and/or records that are to be replicated. As used herein, “data item information” may refer to information associated with data item 440. In some implementations, data set module 430 may store data item information in data item sequence table 450. As used herein, a “data item update” may refer to data item 440 and/or data item information. In some implementations, data set module 430 may manage publication (e.g., pushing and pulling) of data item updates via aggregate message handler 460, summary message handler 470, and/or bulk request handler 480. In some implementations, master device 210 may include multiple data set modules 430, one for each data set stored by master device 210. Additionally, or alternatively, a single data set module 430 may manage multiple data sets stored by master device 210.
Data item sequence table 450 may store data item information. In some implementations, data item sequence table 450 may assign a sequence identifier to each data item update stored in a data set. For example, the sequence identifier may identify a data item 440, an operation (e.g., add, modify, delete) to be performed on data item 440, and/or other information, discussed in more detail in connection with
Aggregate message handler 460 may perform operations associated with pushing data item updates from master device 210 to slave device 220. In some implementations, aggregate message handler 460 may determine which data item updates to push to slave devices 220, and may push the determined data item updates to slave devices 220 based on a publication trigger. For example, the publication trigger may include a quantity of unpublished data item updates satisfying a threshold; a quantity of slave devices 220, capable of receiving the data item updates, satisfying a threshold; and/or an expiration of a publication timer.
Summary message handler 470 may perform operations associated with notifying slave devices 220 of data item updates. For example, summary message handler 470 may periodically transmit a summary message to slave device 220 that contains an indication of most recent publication (e.g., an indication of a most recently published data item update, such as a sequence identifier that references the data item update). Slave device 220 may use the indication to determine whether slave device 220 is synchronized with the most recent data item update (e.g., whether the data sets stored on slave device 220 match the corresponding data sets stored on master device 210).
Bulk request handler 480 may perform operations associated with responding to pull requests from slave devices 220. For example, bulk request handler 480 may receive a pull request, from slave device 220, that indicates a data item update that is missing from a memory of slave device 220. Bulk request handler 480 may transmit the missing data item update to slave device 220.
The number of functional components illustrated in
As illustrated in
As further illustrated in
In some implementations, the sequence identifier stored by master device 210 may reference a data item identifier for data item 440 identified by the data item update received by master device 210. The data item identifier may identify data item 440. Additionally, or alternatively, the sequence identifier may reference an operation identifier for the operation identified by the data item update received by master device 210. The operation identifier may identify an operation (e.g., add, modify, or delete) to be performed on data item 440. Additionally, or alternatively, the sequence identifier may reference a memory location for the data item 440 identified by the data item update received by master device 210. The memory location may identify a location where data item 440 is stored in memory (e.g., on master device 210 and/or on another device). Additionally, or alternatively, the sequence identifier may reference a timestamp. The timestamp may indicate a time at which the data item update (e.g., data item 440, the sequence identifier, the data item identifier, the operation identifier, the memory location, and/or the timestamp) is received, processed, and/or stored by master device 210.
When storing a data item update in memory, master device 210 may use a sequence identifier to reference the data item update. In some implementations, master device 210 may determine a most recently used and/or stored sequence identifier, and may increment the most recently used/stored sequence identifier to generate a new sequence identifier to reference the data item update. For example, master device 210 may receive a data item update, may determine that the most recently used sequence identifier is three (3), and may assign a sequence identifier of four (4) to reference the received data item update.
Returning to
As illustrated in
As illustrated in
As illustrated in
As further illustrated in
While a series of blocks has been described with regard to
Data structure 600 may include a collection of fields, such as a sequence identifier field 610, a data item identifier field 620, an operation identifier field 630, a memory location field 640, and a timestamp field 650.
Sequence identifier field 610 may store information that identifies a sequence identifier. For example, the sequence identifier may be a number, a letter, a timestamp, or any other identifier capable of indicating an order in which information is received, processed, stored, etc.
Data item identifier field 620 may store information that identifies data item 440 referenced by the sequence identifier identified by sequence identifier field 610. For example, data item 440 may be identified by a number, a letter, a file name, a memory location, or any other identifier capable of identifying data item 440.
Operation identifier field 630 may store information that identifies an operation referenced by the sequence identifier identified by sequence identifier field 610. The operation may be an operation to be performed or that has already been performed on data item 440 identified by data item identifier field 620. For example, the operation may be an add operation, a modify operation, or a delete operation.
Memory location field 640 may store information that identifies a memory location referenced by the sequence identifier identified by sequence identifier field 610. The memory location may be a memory location where data item 440 identified by data item identifier field 620 is stored, or where a modified data item 440 (e.g., created by modifying the data item 440 identified by data item identifier field 620) is stored. For example, the memory location may specify a memory address, a memory block, a memory register, etc.
Timestamp field 650 may store information that identifies a date and/or a time referenced by the sequence identifier identified by sequence identifier field 610. In some implementations, the date/time may be a date/time when a data item update was received, processed, and/or stored by master device 210. For example, the date/time may be a date/time when the information stored in fields 610, 620, 630, 640, and/or 650 was received, processed, stored, etc. by master device 210.
Information associated with a single sequence identifier may be conceptually represented as a row in data structure 600. For example, the first row in data structure 600 may correspond to a sequence identifier of “1,” a data item identifier of “A,” an operation identifier of “add,” a memory location of “memory locations 10-100,” and a timestamp of “8/24/2012, 10:05:42.”
In some implementations, master device 210 may remove a reference to data item 440 when information that identifies an operation to modify and/or delete data item 440 is received, processed, stored, etc., as indicated by reference number 660. For example, the third row in data structure 600 is associated with a modification of data item A. Upon receiving, processing, and/or storing the information that identifies the operation, master device 210 may remove information in the first row of data structure 600 (which also corresponds to data item A), from data item sequence table 450. Likewise, upon receiving, processing, and/or storing information that identifies the delete operation associated with data item B in the fourth row of data structure 600, master device 210 may remove information in the second row of data structure 600 (which also corresponds to data item B), from data item sequence table 450. In some implementations, master device 210 may remove the information stored in fields 620-650, and may retain the information stored in field 610. Additionally, or alternatively, master device 210 may remove the information stored in fields 610-650 in any combination. In some implementations, master device 210 may remove information associated with data item 440 referenced by a previous sequence identifier so that only one sequence identifier (e.g., the most recently created/stored sequence identifier) references data item 440.
Data structure 600 includes fields 610-650 for explanatory purposes. In practice, data structure 600 may include additional fields, fewer fields, different fields, or differently arranged fields than those illustrated in
As illustrated in
Reference number 710 indicates that master device 210 may receive an indication to add data items A, B, and C to a memory of master device 210. In some implementations, master device 210 may store data items A, B, and C in memory based on the indication. Additionally, or alternatively, master device 210 may store a reference to data items A, B, and C, as well as a reference to the add operation, in data item sequence table 450. The “Add A” operation may be referenced by sequence identifier 1, the “Add B” operation may be referenced by sequence identifier 2, and the “Add C” operation may be referenced by sequence identifier 3, as illustrated.
Reference number 720 indicates that master device 210 may receive an indication to modify data item A to produced modified data item A2 (e.g., replace A with A2). In some implementations, master device 210 may modify data item A in memory, to produce modified data item A2 (e.g., may store modified data item A2 in memory, and may remove data item A from memory) based on the indication. Additionally, or alternatively, master device 210 may store a reference to modified data item A2 in data item sequence table 450. The “Modify A to A2” operation may be referenced by sequence identifier 4 (e.g., the next sequence identifier), as illustrated. Master device 210 may also remove the previous reference to data item A, referenced by sequence identifier 1, from data item sequence table 450. After the removal, sequence identifier 1 may be associated with an empty (e.g., null) entry in data item sequence table 450.
Reference number 730 indicates that master device 210 may receive an indication to delete data item B from a memory of master device 210. In some implementations, master device 210 may delete data item B from memory based on the indication. Additionally, or alternatively, master device 210 may store a reference to deleted data item B in data item sequence table 450. The “Delete B” operation may be referenced by sequence identifier 5 (e.g., the next sequence identifier), as illustrated. Master device 210 may also remove the previous reference to data item B, referenced by sequence identifier 2, from data item sequence table 450.
Reference number 740 indicates that master device 210 may determine that a deletion trigger timer has expired for deleted data item B. The deletion trigger may be based on a timestamp associated with sequence identifier 5 satisfying a threshold. Upon receiving the deletion trigger, master device 210 may remove the reference to the deletion of data item B (e.g., “Delete B”), referenced by sequence identifier 5, from data item sequence table 450.
The information received and stored by master device 210, as indicated by reference numbers 710-740 and fields 610-630, is provided for explanatory purposes. In practice, master device 210 may receive and/or store additional information, less information, different information, and/or differently arranged information than illustrated in
As illustrated in
In some implementations, master device 210 may trigger aggregation of unpublished data item updates based on an aggregation timer satisfying a threshold. For example, master device 210 may determine an amount of time that has passed since a previous aggregation was triggered, since a previous publication was sent, etc., and may trigger aggregation based on the amount of time satisfying a threshold.
As further illustrated in
The most recent publication may refer to a data item update most recently published (e.g., pushed) by master device 210. In some implementations, master device 210 may determine the second sequence identifier of the most recent publication by storing the most recent sequence identifier (e.g., the highest sequence number) of the most recent publication.
In some implementations, master device 210 may determine the unpublished data item updates as the data item updates referenced by a sequence identifier more recent than the sequence identifier of the most recent publication. Additionally, or alternatively, master device 210 may determine the unpublished data item updates as the data item updates referenced by a sequence identifier falling between the first sequence identifier and the second sequence identifier (including the first sequence identifier).
As further illustrated in
Master device 210 may publish the aggregated data item updates based on receiving a publication trigger. In some implementations, the publication trigger may be based on a publication timer satisfying a threshold. For example, master device 210 may determine an amount of time that has passed since a previous publication was triggered, since a previous publication was sent, since an aggregation was triggered, etc., and may trigger publication based on the amount of time satisfying a threshold. Additionally, or alternatively, the publication trigger may be based on a quantity of slave devices 220, capable of receiving the publication, satisfying a threshold. For example, master device 210 may determine that a quantity of slave devices 220, that are powered on and/or able to communicate with master device 210, satisfies a threshold, and may trigger publication based on the determination.
As further illustrated in
As further illustrated in
While a series of blocks has been described with regard to
As illustrated in
Reference number 910 indicates a most recent publication (e.g., a most recently published data item update), associated with sequence identifier 2. For example, reference number 910 may indicate that during the most recent publication (e.g., a push publication) to slave devices 220, master device 210 published data item 440 and/or data item information associated with data item 440, referenced by sequence identifier 2.
Reference number 920 indicates a most recent update (e.g., a most recently received, processed, and/or stored data item update), associated with sequence identifier 5. For example, reference number 920 may indicate that data item 440 and/or data item information associated with data item 440, referenced by sequence identifier 5, was received, processed, and/or stored most recently (e.g., when compared to another data item update received, processed, and/or stored) by master device 210.
Reference number 930 indicates that data item updates referenced by sequence identifiers 3, 4, and 5, are to be published, by master device 210, to slave devices 220. In some implementations, master device 210 may determine to publish data item updates associated with sequence identifiers 3, 4, and 5 because these sequence identifiers are more recent than the most recent publication 910 (e.g., referenced by sequence identifier 2). Additionally, or alternatively, master device 210 may determine to publish data item updates associated with sequence identifiers 3, 4, and 5 because these sequence identifiers fall in between the most recent publication 910 (e.g., referenced by sequence identifier 2) and the most recent update 920 (e.g., referenced by sequence identifier 5), including sequence identifier 5, but not including sequence identifier 2.
When publishing data items to slave devices 220, master device 210 may transmit different information based on the operation identified by the data item update being published. For example, sequence identifier 3 is associated with an add operation (“Add C”). When publishing a data item update that includes an add operation, master device 210 may transmit the data item 440 associated with the add operation (e.g., data item C), a data item identifier that identifies data item 440 (e.g., an identifier for data item C), and/or an operation identifier that identifies the operation to be performed on data item 440 (e.g., add data item C).
As another example, sequence identifier 4 is associated with a modify operation (“Modify A to A2”). When publishing a data item update that includes a modify operation, master device 210 may transmit the data item 440 associated with the modify operation (e.g., data item A2), a data item identifier that identifies a data item 440 to be modified (e.g., an identifier for data item A), and/or an operation identifier that identifies the operation to be performed on the data item 440 to be modified (e.g., modify data item A to data item A2).
As another example, sequence identifier 5 is associated with a delete operation (“Delete B”). When publishing a data item update that includes a delete operation, master device 210 may transmit a data item identifier that identifies a data item 440 to be deleted (e.g., an identifier for data item B), and/or an operation identifier that identifies the operation to be performed on the data item 440 (e.g., delete data item B). For delete operations, master device 210 may not transmit the data item 440 associated with the delete operation because the data item 440 associated with the delete operation has been deleted by master device 210.
The information updated and published by master device 210, as indicated by reference numbers 910-930 and fields 610-630, is provided for explanatory purposes. In practice, master device 210 may update and/or publish additional information, less information, different information, and/or differently arranged information than illustrated in
As illustrated in
As further illustrated in
As further illustrated in
As further illustrated in
While a series of blocks has been described with regard to
As illustrated in
Reference number 1110 indicates a request, received from slave device 220, for a data item update referenced by sequence identifiers 2-5 (e.g., 2, 3, 4, and 5). Slave device 220 may transmit the request to master device 210.
Reference number 1120 indicates a data item update that will not be published to slave device 220 because sequence identifier 2 is associated with an empty (e.g., null) entry. In other words, master device 210 has removed the information associated with sequence identifier 2 (e.g., discussed in connection with reference number 730,
Reference number 1130 indicates that a data item update referenced by sequence identifiers 3, 4, and 5, are to be published, by master device 210, to slave device 220. In some implementations, master device 210 may determine to publish information associated with sequence identifiers 3, 4, and 5 because these sequence identifiers are associated with available, requested data item updates. When publishing data item updates to slave devices 220, master device 210 may send different information based on the operation associated with the data item update, as discussed herein in connection with
The information received and published by master device 210, as indicated by reference numbers 1110-1130 and fields 610-630, is provided for explanatory purposes. In practice, master device 210 may receive and/or publish additional information, less information, different information, and/or differently arranged information than illustrated in
Data set registration table 1210 may perform operations associated with creating and managing data sets. In some implementations, data set registration table 1210 register a data set, unregister a data set, update a data set, enable access to a data set, and/or disable access to a data set in the same manner as data set registration table 410 (
Messaging layer 1220 may perform operations associated with communicating with master device 210. For example, messaging layer 1220 may enable slave device 220 to be aware of master device 210, and to communicate with master device 210. In some implementations, messaging layer 1220 may receive a data item update from master device 210 via multicasting. For example, slave device 220 may subscribe to a multicast update for a particular data set (e.g., a data set stored and/or to be stored by slave device 220). Master device 210 may transmit updates to the particular data set to slave devices 220 that are subscribed to the multicast update for the particular data set. Additionally, or alternatively, messaging layer 1220 may transmit a pull request to master device 210, and may receive a data item update from master device 210 in response to the pull request.
Data set module 1230 may perform operations associated with maintaining data sets. In some implementations, data set module 1230 may store data items 1240. Data items 1240 stored by slave device 220 may correspond to data items 440 stored by master device 210. In some implementations, data set module 1230 may store data item information in data item sequence table 1250. In some implementations, data set module 1230 may manage receiving data item updates via aggregate message handler 1260, summary message handler 1270 (which may detect missing data item updates), and/or bulk request handler 1280, as explained in further detail in connection with
Data item sequence table 1250 may store data item information. The information stored by data item sequence table 1250 on slave device 220 may correspond to the information stored by data item sequence table 450 on master device 210.
Aggregate message handler 1260 may perform operations associated with receiving data item updates from master device 210. In some implementations, aggregate message handler 1260 may receive data item updates pushed from master device 210.
Summary message handler 1270 may perform operations associated with receiving notifications, from master device 210, associated with data item updates. For example, summary handler 1270 may periodically receive a summary message from master device 210 that contains an indication of the most recent publication (e.g., a most recently published data item update). Slave device 220 may use the indication to determine whether slave device 220 is synchronized with master device 210 (e.g., whether the data sets shared by master device 210 and slave device 220 are identical).
Bulk request handler 1280 may perform operations associated with requesting and/or receiving missing data item updates from master device 210. For example, bulk request handler 1280 may transmit a pull request, to master device 210, that identifies a data item update that is missing from a memory of slave device 220. Bulk request handler 1280 may receive the missing data item update from master device 210.
The number of functional components illustrated in
As illustrated in
As further illustrated in
In some implementations, slave device 220 may automatically create and store a missing sequence identifier that falls between received sequence identifiers. Slave device 220 may store an empty entry, referenced by the missing sequence identifier. In some implementations, slave device 220 may request, from master device 210, a data item update for a sequence identifier associated with an empty entry on slave device 220. In this implementation, slave device 220 may store impacted sequence identifiers that are associated with an empty entry as a result of information being removed due to a modify or delete operation. Slave device 220 may not use the impacted sequence identifiers when requesting missing data item updates from master device 210. Additionally, or alternatively, slave device 220 may delete the stored impacted sequence identifiers more recent than the old sequence identifier and less recent than or equally as recent as the new sequence identifier, after processing the most recently received summary message (e.g., in process block 1370).
In some implementations, slave device 220 may request the missing data item update based on receiving a request trigger. In some implementations, the request trigger may be based on a request timer satisfying a threshold. For example, slave device 220 may determine an amount of time that has passed since a previous request was triggered, since a previous request was sent by slave device 220 to master device 210, etc., and may trigger sending of the request based on the amount of time satisfying a threshold. Additionally, or alternatively, the request trigger may be based on a determination that master device 210 is capable of responding to the request. For example, slave device 210 may determine that master device 210 is powered on and/or able to communicate with slave device 220, and may trigger the request based on the determination.
Returning to
In some implementations, slave device 220 may determine whether all requested data item updates have been received by using a request list that keeps track of missing data item updates. Slave device 220 may store the request list, and the request list may store a list of missing data item updates. Slave device 220 may send requests to master device 210 for missing data item updates identified by the request list. When slave device 220 receives a missing data item update, that missing data item update may be removed from the request list. An empty request list indicates that slave device 220 has received all missing data item updates. A non-empty request list indicates that slave device 220 has not received all missing data item updates. In some implementations, slave device 220 may request multiple data items 440 (e.g., identified by sequence identifiers), and may periodically send requests for data items 440 that have not been received. As data items 440 are received by slave device 220, the request list may be updated to remove the received data item updates.
As further illustrated in
While a series of blocks has been described with regard to
As illustrated in
Reference number 1410 indicates a first summary message sent from master device 210 to slave device 220. The first summary message indicates that a most recently published data item update is referenced by sequence identifier 1. The first summary message may be sent by master device 210 to slave device 220 at a first time T=1.
Reference number 1420 indicates a second summary message sent from master device 210 to slave device 220. The second summary message indicates that a most recently published data item update is referenced by sequence identifier 5. The second summary message may be sent by master device 210 to slave device 220 at a second time T>1.
Reference number 1430 indicates that slave device 220 may determine that slave device 220 is missing data item updates associated with sequence identifiers 2, 3, and 5. For example, slave device 220 may check a request list, stored by slave device 220, that identifies sequence identifiers 2, 3, and 5 as missing data item updates.
Reference number 1440 indicates a request, from slave device 220 to master device 210, for data item updates referenced by sequence identifiers 2, 3, and 5. Reference number 1450 indicates that the data item updates, referenced by sequence identifiers 3 and 5, are to be published by master device 210 to slave device 220. Reference number 1460 indicates that the data item update reference by sequence identifier 2 is not published by master device 210 to slave device 220 because it has been previously modified or deleted by master device 210 (e.g., sequence identifier 2 references an empty entry). When publishing data item updates to slave devices 220, master device 210 may send different information based on the operation associated with the data item update, as discussed herein in connection with
The information sent in a summary message and/or published by master device 210, as well as the information determined and/or requested by slave device 220, as indicated by reference numbers 1410-1450 and fields 610-630, is provided for explanatory purposes. In practice, master device 210 and/or slave device 220 may be associated with additional information, less information, different information, and/or differently arranged information than illustrated in
As illustrated in
Additionally, or alternatively, slave device 220 may determine the sequence identifier of the most recent delete operation based on a delete operation received in a response, by master device 210, to a pull request, from slave device 220. For example, slave device 220 may determine the sequence identifier of the most recent delete operation after a response to the pull request is complete (e.g., once slave device 220 is synchronized). Slave device 220 may store the sequence identifier, and may transmit the sequence identifier to master device 210.
As further illustrated in
As further illustrated in
In some implementations, master device 210 may remove data item information for delete operations upon the expiration of a timer. For example, upon determining that the sequence identifier does not reference an empty entry, master device 210 may start a timer. When the timer expires, master device 210 may remove the data item information. Additionally, or alternatively, master device 210 may remove data item information referenced by the old sequence identifier when the old sequence identifier is older than a sequence identifier received from multiple slave devices 220 (e.g., all slave devices 220, or a quantity of slave devices 220 that satisfies a threshold).
As further illustrated in
In some implementations, master device 210 may send a fake delete operation to slave device 220, which is treated as a delete operation by slave device 220. In other words, the sequence identifier that references the fake delete operation may be treated by slave device 220 as the sequence identifier of the most recent delete operation.
In this way, master device 210 may avoid sending a flush indication to slave device 220 when a deletion trigger timer has expired for a delete operation stored by master device 210. For example, master device 210 may send, to slave device 220, a first sequence identifier that references a delete operation for data item 440. Slave device 220 may include the first sequence identifier in a request for a missing data item update. If master device 210 does not send any other delete operations, and a deletion trigger timer expires for the first sequence identifier on master device 210, then the first sequence identifier may be associated with an empty entry, which may cause master device 210 to send a flush indication to slave device 220.
In order to avoid this unnecessary flush, master device 210 may send, to slave device 220, a second sequence identifier that references a fake delete operation. Slave device 220 may include the second sequence identifier in a request for a missing data item update. Thus, when the deletion trigger timer expires for the first sequence identifier on master device 210, it will not cause a flush indication to be sent when the second sequence identifier is received in a request from slave device 220. In some implementations, master device 210 may limit the quantity of fake delete operations sent to slave device 220 per deletion trigger timer expiration period.
While a series of blocks has been described with regard to
As illustrated in
In implementation 1600, assume that master device 210 has received data item updates to add data items A and B, and data item sequence table 450 has been updated to include “Add A” at sequence identifier 1 and “Add B” at sequence identifier 2. Further assume that master device 210 has published the data item updates to slave device 220, and data item sequence table 1250 has been updated to include “Add A” at sequence identifier 1 and “Add B” at sequence identifier 2.
Reference number 1610 indicates that master device 210 may receive a data item update to delete data item A, and data item sequence table 450 may be updated to include “Delete A” at sequence identifier 3. Master device 210 may publish the data item update to slave device 220, which may store the update at sequence identifier 3, and may store sequence identifier 3 as referencing the most recent delete operation (e.g., the delete operation associated with the most recent sequence identifier and/or the highest sequence number).
Reference number 1620 indicates that master device 210 may receive a data item update to delete data item B, and data item sequence table 450 may be updated to include “Delete B” at sequence identifier 4. Master device 210 has lost connectivity with slave device 220, and “Delete B” is not transmitted to slave device 220.
Reference number 1630 indicates that connectivity has been restored between master device 210 and slave device 220. Slave device 220 may request a missing data item update referenced by missing sequence identifier 4, and may transmit, with the request, an indication of sequence identifier 3, which references the most recent delete operation stored in data item sequence table 1250 on slave device 220. Master device 210 may receive the request and the indication of sequence identifier 3, and may determine that sequence identifier 3 does not reference an empty entry. Based on the determination that sequence identifier 3 does not reference an empty entry, master device 210 may determine not to send a flush indication to slave device 220.
Reference number 1640 indicates that master device 210 may send “Delete B,” referenced by sequence identifier 4, to slave device 220. Slave device 220 may update data item sequence table 1250 with “Delete B” at sequence identifier 4, and may store sequence identifier 4 as referencing the most recent delete operation. In some implementations, master device 210 may remove “Delete A” from sequence identifier 3, so that sequence identifier 3 now references an empty entry. This may be done, for example, when there is a single slave device 220. In other implementations, master device 210 may retain “Delete A” in data item sequence table 450 until a deletion trigger timer has expired.
The information sent received, stored, and published by master device 210 and/or slave device 220, as indicated by reference numbers 1610-1640 and fields 610-630, is provided for explanatory purposes. In practice, master device 210 and/or slave device 220 may be associated with additional information, less information, different information, and/or differently arranged information than illustrated in
As illustrated in
In implementation 1600, assume that master device 210 has received data item updates to add data items A and B, and data item sequence table 450 has been updated to include “Add A” at sequence identifier 1 and “Add B” at sequence identifier 2. Further assume that master device 210 has published the data item updates to slave device 220, and data item sequence table 1250 has been updated to include “Add A” at sequence identifier 1 and “Add B” at sequence identifier 2. Also assume that the events described in connection with reference number 1610 (
Reference number 1620 indicates that master device 210 may receive a data item update to delete data item B, and data item sequence table 450 may be updated to include “Delete B” at sequence identifier 4. Master device 210 has lost connectivity with slave device 220, and “Delete B” is not transmitted to slave device 220.
Reference number 1650 indicates that a deletion trigger timer has expired for “Delete A,” referenced by sequence identifier 3, and master device 210 has removed information referenced by sequence identifier 3 to create an empty entry in data item sequence table 450. Master device 210 and slave device 220 are still not connected.
Reference number 1660 indicates that connectivity has been restored between master device 210 and slave device 220. Slave device 220 may request a missing data item update referenced by missing sequence identifier 4, and may transmit, with the request, an indication of sequence identifier 3, which references the most recent delete operation stored in data item sequence table 1250 on slave device 220. Master device 210 may receive the request and the indication of sequence identifier 3, and may determine that sequence identifier 3 references an empty entry. Based on the determination that sequence identifier 3 references an empty entry, master device 210 may send a flush indication to slave device 220.
Reference number 1670 indicates that master device 210 may send a flush indication to slave device 220, and slave device 220 may receive the flush indication. Based on receiving the flush indication, slave device 220 may flush data item updates from a memory of slave device 220, and may remove all entries (including sequence identifiers) from data item sequence table 1250.
Initialization state 1705 may indicate that slave device 220 is being initialized. For example, slave device 220 may be initialized by deleting a data set from slave device 220 (e.g., deleting all data items 1240 in the data set, and all data item information in the data set). In some implementations, slave device 220 may be initialized by setting all data item attributes to a default value (e.g., a null value). Initialization state 1705 may be triggered by flush event 1745, may be triggered by data set registration, and/or may be triggered when slave device 220 is powered up and/or restarted.
Start event 1710 may transition slave device 220 from initialization state 1705 to connectivity check state 1715. In some implementations, start event 1705 may be triggered after initialization of slave device 220. Additionally, or alternatively, start event 1705 may be triggered by flush event 1745, by data set registration, by powering up of slave device 220 and/or by restarting slave device 220.
Connectivity check state 1715 may indicate that slave device 220 is checking connectivity between slave device 220 and master device 210. In some implementations, slave device 220 may determine that master device 210 is powered up, that slave device 220 is able to communicate with master device 210, and/or that master device 210 is able to communicate with slave device 220. For example, slave device 220 may ensure that push and/or pull communications between slave device 220 and master device 210 are enabled.
In some implementations, slave device 220 may transmit an echo request to master device 210 that includes a location identifier that identifies a destination address and/or location for communications with slave device 220. Slave device 220 may also start an echo retransmit timer when transmitting the echo request. Master device 210 may receive the echo request, and may send an echo response to slave device 220. In some implementations, master device 210 may send an echo response to a set of slave devices 220 (e.g., all slave devices 220 in a distributed computing environment). The echo response may include a location identifier for each location identifier received by master device 210. When slave device 220 receives an echo response with the location identifier for slave device 220, slave device 220 may determine that the connectivity check was successful, which may trigger sync request event 1725. If the echo retransmit timer expires before an echo request is received by slave device 220, slave device 220 may trigger re-check connectivity event 1720.
Re-check connectivity event 1720 may be triggered when an echo retransmit timer expires before an echo response to an echo request from slave device 220 is received. Re-check connectivity event 1720 may trigger connectivity check state 1715, which may cause slave device 220 to re-check connectivity with master device 210 by sending another echo request and starting another echo retransmit timer.
Sync request event 1725 may transition slave device 220 from connectivity check state 1715 to sync in progress state 1730. In some implementations, sync request event 1725 may be triggered by a successful connectivity check (e.g., when slave device 220 receives an echo response before expiration of the echo retransmit timer). Additionally, or alternatively, sync request event 1725 may be triggered during sync in progress state 1730 or synced state 1740. For example, sync request event 1725 may be triggered when slave device 220 determines that slave device 220 is missing a data item update from master device 210.
Sync in progress state 1730 may indicate that slave device 220 is being updated with data item updates. For example, sync in progress state 1730 may include receiving, by slave device 220, a data item update from master device 210. Additionally, or alternatively, sync in progress state 1730 may include requesting, by slave device 220, a missing data item update from master device 210. Slave device 220 may remain in sync in progress state 1730 until a list of missing data item updates, stored by slave device 220, is empty.
Sync done event 1735 may transition slave device 220 from sync in progress state 1730 to synced state 1740. In some implementations, sync done event 1735 may be triggered when slave device 220 determines that it is not missing any data item updates from master device 210. For example, sync done event 1735 may be triggered when a list of missing data item updates, stored by slave device 220, is empty.
Synced state 1740 may indicate that slave device 220 is synchronized with master device 210. For example, synced state 1740 may indicate that a data set stored on slave device 220 matches a corresponding data set stored on master device 210.
Flush event 1745 may transition slave device 220 from connectivity check state 1715, sync in progress state 1730, or synced state 1740, to initialization state 1705. In some implementations, flush event 1745 may cause slave device 220 to be initialized (e.g., to delete all data items 1240 in a data set indicated by the flush event, and to delete all data item information in the data set). In some implementations, flush event 1745 may be triggered when master device 210 is restarted. Restarting master device 210 may cause all data sets stored by slave device 220 to be flushed. Additionally, or alternatively, flush event 1745 may be triggered for a particular data set when master device 210 determines that there is a stale data item in the particular data set (e.g., that a sequence identifier of a most recent delete operation, received from slave device 220, references an empty entry on master device 210, discussed herein in connection with
Implementations described herein may assist in synchronizing devices in a distributed computing environment (such as master devices and slave devices) so that a local memory of each device stores updated information.
The foregoing disclosure provides illustration and description, but is not intended to be exhaustive or to limit the embodiments to the precise form disclosed. Modifications and variations are possible in light of the above disclosure or may be acquired from practice of the embodiments.
As used herein, the term “component” is intended to be broadly construed as hardware, firmware, or a combination of hardware and software.
Some implementations are described herein in conjunction with thresholds. The term “greater than” (or similar terms), as used herein to describe a relationship of a value to a threshold, may be used interchangeably with the term “greater than or equal to” (or similar terms). Similarly, the term “less than” (or similar terms), as used herein to describe a relationship of a value to a threshold, may be used interchangeably with the term “less than or equal to” (or similar terms). As used herein, “satisfying” a threshold (or similar terms) may be used interchangeably with “being greater than a threshold,” “being greater than or equal to a threshold,” “being less than a threshold,” “being less than or equal to a threshold,” or other similar terms.
It will be apparent that systems and/or methods, as described herein, may be implemented in many different forms of software, firmware, and hardware in the implementations illustrated in the figures. The actual software code or specialized control hardware used to implement these systems and/or methods is not limiting of the implementations. Thus, the operation and behavior of the systems and/or methods were described without reference to the specific software code—it being understood that software and control hardware can be designed to implement the systems and/or methods based on the description herein.
Even though particular combinations of features are recited in the claims and/or disclosed in the specification, these combinations are not intended to limit the disclosure of possible implementations. In fact, many of these features may be combined in ways not specifically recited in the claims and/or disclosed in the specification. Although each dependent claim listed below may directly depend on only one claim, the disclosure of possible implementations includes each dependent claim in combination with every other claim in the claim set.
No element, act, or instruction used herein should be construed as critical or essential unless explicitly described as such. Also, as used herein, the articles “a” and “an” are intended to include one or more items, and may be used interchangeably with “one or more.” Where only one item is intended, the term “one” or similar language is used. Further, the phrase “based on” is intended to mean “based, at least in part, on” unless explicitly stated otherwise.