WO2016134639A1 - 一种数据块处理方法和设备 - Google Patents

一种数据块处理方法和设备 Download PDF

Info

Publication number
WO2016134639A1
WO2016134639A1 PCT/CN2016/073594 CN2016073594W WO2016134639A1 WO 2016134639 A1 WO2016134639 A1 WO 2016134639A1 CN 2016073594 W CN2016073594 W CN 2016073594W WO 2016134639 A1 WO2016134639 A1 WO 2016134639A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
block information
log
tablet data
tablet
Prior art date
Application number
PCT/CN2016/073594
Other languages
English (en)
French (fr)
Inventor
饶志涛
Original Assignee
阿里巴巴集团控股有限公司
饶志涛
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 饶志涛 filed Critical 阿里巴巴集团控股有限公司
Priority to US15/553,050 priority Critical patent/US20180032567A1/en
Priority to EP16754748.8A priority patent/EP3264291A4/en
Priority to JP2017544648A priority patent/JP6633642B2/ja
Publication of WO2016134639A1 publication Critical patent/WO2016134639A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data block processing method, and a data block processing device.
  • Oceanbase is a mainstream distributed database. Similar to other distributed databases, the oceanbase storage engine is implemented by combining the disks of thousands of ordinary PC servers. The disks in each pc server are stored. The engine is divided into blocks of storage blocks for storing data, that is, logical block block data blocks. In the oceanbase database, a tablet data block can only belong to a certain table in the oceanbase database.
  • a table in the database can have multiple tablet data blocks according to the size of the data volume, that is, the tablet data block and the table in the oceanbase database. Relationships are many-to-one relationships. As the basic storage unit of the distributed database storage engine, the number of tablet data blocks on the pc server is very large. In order to ensure the high availability of the distributed database, there are multiple copies of the tablet data block, that is, the same data will exist in multiple On the data block of the tablet, and over time, the insertion, deletion, update of data, and the load balancing of the distributed database system, the tablet data block will have very complicated operations such as splitting, migrating, merging, etc. Once it fails, it will result in the loss of the copy or the inconsistency of the data between the copies. Due to the inherent high complexity of large distributed database systems, such as the need to deal with data consistency, high availability of the system, fault tolerance of partitions, and so on, it is difficult to control the rationality and correctness of the distribution of tablet data blocks.
  • real-time tracking of the change state of the tablet data block can accurately grasp the detailed distribution of the tablet data block on the disk of each pc server, so that we can analyze the tablet data block in each pc.
  • the rationality of the distribution on the disk on the server, for the specific distribution of the tablet data block on some pc server or pc sever can be early warning, so as to bring additional business value to the user; can accurately grasp each piece The distribution position of the table data block of the table, thereby obtaining the change state of the table data block of each table during its lifetime, providing the user with additional business value; the entire data storage of the distributed database can be fully monitored and accurately Positioning the storage location of the data segment provides additional business value to the user.
  • real-time tracking of the change state of the tablet data block in the distributed database can bring many other benefits. Correlate the table data block in the distributed database obtained in real time, and timely alarm the data inconsistency in the tablet data block, provide a basis for subsequent automation or human flesh processing, and prevent the block data block caused by the program bug. Trouble or loss, report bugs to developers of distributed databases, and solve the bugs to further improve the stability and high availability of distributed databases.
  • the root table is manually searched for the root table to obtain the data information of the tablet data block for tracking.
  • the technique is that the tablet data block information of each table is obtained by manually obtaining the table data block information of each table from the oceanbase root table system table when the tablet data block is lost or the tablet data block is inconsistent, and the table data block information of each table stored in the oceanbase root table is only
  • the current latest block data block information that is, the existing mode can only obtain the current state data of the tablet data block, and cannot continuously track the state of the tablet data block over time.
  • the existing verification method is to obtain the log data block related log by manually traversing the storage database log of the oceanbase, and integrate the information of the log and compare it with the related data of the tablet data block corresponding to the table in the oceanbase root table system table.
  • the disadvantage is that the efficiency is very low; in addition, in order to prevent the disk space from being heavily occupied by the log files, the oceanbase periodically cleans the logs before a certain time, and the logs are cleared, causing the occupies of the oceanbase manually.
  • the log data of the tablet data block obtained by the storage server log is incomplete, which may result in inaccurate verification results.
  • the prior art cannot continuously track the changing state of the tablet data block over time, and on the other hand, the prior art verification has the disadvantages of very low efficiency and inaccurate verification result.
  • the embodiment of the present application provides a data block processing method and device, which can track the change state of a tablet data block in real time, and efficiently and accurately verify the tablet data block information.
  • An embodiment of the present application provides a data block processing method, which is applied to a system including a storage server, a control server, and a merge server, where the method includes the following steps:
  • control server When the control server receives the log that is sent by the storage server and carries the tablet data block information, the control server acquires the tablet data block information carried in the log;
  • the control server queries the merge server for the tablet data block information in the corresponding root table root table according to the tablet data block information carried in the log;
  • the control server determines whether the tablet data block information carried in the log is consistent with the tablet data block information in the root table
  • the control server aggregates the tablet data block information carried in the log and the tablet data block information in the root table, and performs an alarm when the determination result is inconsistent.
  • control server queries the merge server for the tablet data block information in the corresponding root table according to the tablet data block information carried in the log, which specifically includes:
  • the control server determines a table name corresponding to the tablet data block information carried in the log
  • the control server queries the merge server for the tablet data block information in the root table corresponding to the table name.
  • control server determines whether the tablet data block information carried in the log is consistent with the tablet data block information in the root table, and specifically includes:
  • the control server checks whether the tablet data block information carried in the log is consistent with one or more of the following information corresponding to the tablet data block information in the root table:
  • control server determines that the tablet data block information carried in the log is inconsistent with the tablet data block information in the root table.
  • control server stores the tablet data block information carried in the log.
  • tablet data block information in the root table is aggregated and stored, including:
  • the control server summarizes the tablet data block information carried in the log and the tablet data block information in the root table
  • the control server uses the table name corresponding to the tablet data block as the key value, and persistently saves the summarized tablet data block information to the disk.
  • An embodiment of the present application provides a data block processing method, which is applied to a system including a storage server, a control server, and a merge server, where the method includes the following steps:
  • the storage server polls its own log
  • the storage server determines that new data information appears in the log, identifying whether the new data information is tablet data block information;
  • the storage server sends a log carrying the tablet data block information to the control server, so that the control server uses the tablet data block information carried in the log and the root table of the merge server.
  • the block data block information in the block is consistently identified and aggregated.
  • control server which is applied to a system including a storage server, a control server, and a merge server, where the control server includes:
  • a receiving module configured to receive a log that is sent by the storage server and carries information of the tablet data block
  • An acquiring module configured to acquire, when the receiving module receives the log that carries the tablet data block information sent by the storage server, the tablet data block information carried in the log;
  • a querying module configured to query the merged server for the tablet data block information in the corresponding root table according to the tablet data block information carried in the log obtained by the obtaining module;
  • a determining module configured to determine whether the tablet data block information carried in the log obtained by the obtaining module is consistent with the tablet data block information in the root table queried by the query module;
  • a processing module configured to perform summary storage on the tablet data block information carried in the log obtained by the obtaining module and the tablet data block information in the root table queried by the query module, and in the When the judgment result of the judgment module is inconsistent, an alarm is issued.
  • the query module is specifically configured to:
  • the determining module specifically includes:
  • the tablet data block information carried in the log obtained by the obtaining module and the tablet data in the root table queried by the query module are determined.
  • the block information is inconsistent.
  • the processing module specifically includes:
  • the table name corresponding to the tablet data block is used as the key value, and the summarized tablet data block information is persistently saved to the disk.
  • the embodiment of the present application provides a storage server, which is applied to a system including a storage server, a control server, and a merge server, where the storage server includes:
  • a polling module configured to poll the storage server's own log
  • An identification module configured to: when the rotation training module determines that new data information appears in the log, identify whether the new data information is tablet data block information;
  • a sending module configured to send, when the recognition result of the identification module is YES, a log carrying the tablet data block information to the control server, so that the control server is configured according to the tablet data carried in the log
  • the block information is consistently identified and aggregated with the tablet data block information in the root table of the merge server.
  • the present application can obtain the status data of the tablet data block of each table in real time, and store the acquired data in a persistent manner on the disk, according to the persistent storage.
  • the data to the disk can describe the state change diagram of the tablet data block of each table in the lifetime time range, and achieve the effect of continuously tracking the state change of the tablet data block.
  • the related information of the tablet data block obtained in the present application can be real-time.
  • the table data block of each table in the database is correlated and verified, and the block data block generated by the early warning program bug can be disordered and lost in real time, efficiently and accurately, thereby solving the disadvantages of low efficiency and inaccurate verification result of the existing solution. .
  • FIG. 1 is a schematic structural diagram of a database in a specific embodiment of the present application.
  • FIG. 2 is a schematic flowchart diagram of a data block processing method according to the present application.
  • FIG. 3 is a schematic flowchart diagram of a data block processing method according to the present application.
  • FIG. 4a is a schematic flowchart of a storage server log parsing background program in a specific embodiment of the present application
  • 4b is a schematic diagram of a workflow of a control server in a specific embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a processing device of a database data block according to the present application.
  • FIG. 6 is a schematic structural diagram of a processing device of a database data block according to the present application.
  • the embodiment of the present application provides a structural diagram of a database, which may be, for example, Oceanbase.
  • a database which may be, for example, Oceanbase.
  • the database uses a fixed three-layer structure to store metadata such as location information of logical blocks (tablet data blocks), and the third layer.
  • Table together constitutes the system's entire root table (root table):
  • A The rightmost side is the user table, which is not a root table.
  • Each user table is split into multiple tablets in the daily merge according to the configuration size, and each tablet stores part of the user table data, and all tablet fragments constitute all the data of the entire user table;
  • the third layer is the metadata table of the user table, called the user meta table.
  • Each user table corresponds to a user meta table, and a row of data in the user meta table corresponds to a tablet in the user table, and the row data stores the table boundary value, location distribution, check value, index, and the like of the user table.
  • the user meta table can be split into multiple tablets in the daily merge according to the configuration size, and each tablet stores part of the user meta table data;
  • the second layer is the metadata table of the user meta table, called the user root table.
  • Each row corresponds to a tablet in the third layer, and stores the tablet boundary value, location distribution, check value, index information, etc. of the user meta table.
  • the user root table has only one tablet, and the tablet does not allow splitting;
  • the first layer is the entry for all user root tables, called the first root table. Each row corresponds to a user root table in the second layer, and stores the tablet boundary, location distribution, check value, index information, etc. to which the user root table belongs.
  • the first root table has only one tablet, and the tablet does not allow splitting.
  • the tablet data block There are multiple copies of the tablet data block in the oceanbase database, that is, the same data will exist on multiple tablet data blocks, and the insertion, deletion, update, and load balancing of the distributed database system over time Needed, the tablet data block will have very complicated operations such as splitting, migrating, merging, etc. If these operations fail, they will result in the loss of the copy or the inconsistency of the data between the copies. Therefore, real-time tracking of the change state of the tablet data block can achieve the effect of continuously tracking the state change of the tablet data block. According to the obtained information about the tablet data block, the table data block of each table in the oceanbase can be correlated and verified in real time. Real-time, efficient, and accurate early warning program bugs caused by the disorder and loss of tablet data blocks.
  • FIG. 2 is a schematic flowchart of a data block processing method proposed in the present application, which is applied to a system including a storage server, a control server, and a merge server, and the method Includes the following steps:
  • Step S201 When the control server receives the log that is sent by the storage server and carries the logical data block tablet data block information, the control server acquires the tablet data block information carried in the log.
  • the step specifically includes: the control server receives a log carrying the tablet data block information reported from the storage server, parses the log, and extracts the tablet data block information corresponding to the log. .
  • the tablet data block information includes but is not limited to one or more of the following: a table name corresponding to the tablet data block, a boundary corresponding to the tablet data block, a position distribution of the tablet data block, and a data check code of the tablet data block.
  • Information such as the index of the tablet data block, the creation time of the tablet data block, and the size of the tablet data block.
  • Step S202 the control server queries the merge server for the tablet data block information in the corresponding root table root table according to the tablet data block information carried in the log.
  • the processing flow of this step specifically includes:
  • the control server determines a table name corresponding to the tablet data block information carried in the log; the control server queries the merge server for the tablet data block information in the root table corresponding to the table name.
  • Step S203 the control server determines whether the tablet data block information carried in the log is consistent with the tablet data block information in the root table
  • the processing flow of this step specifically includes:
  • the control server verifies whether the tablet data block information carried in the log is consistent with one or more of the following information corresponding to the tablet data block information in the root table: table name, boundary, location distribution, data school Check code, index and other information, creation time, size.
  • control server determines that the log carries The tablet data block information is inconsistent with the tablet data block information in the root table.
  • control server determines that the tablet data block information carried in the log is consistent with the tablet data block information in the root table.
  • step S204 needs to be performed regardless of the judgment result, and step S205 needs to be performed when the determination result is inconsistent.
  • Step S204 the control server aggregates and stores the tablet data block information carried in the log and the tablet data block information in the root table.
  • the step specifically includes: the control server summarizes the tablet data block information carried in the log and the tablet data block information in the root table;
  • the control server uses the table name corresponding to the tablet data block as a key value, and persistently saves the summarized tablet data block information to the disk;
  • step S205 the control server performs an alarm.
  • the present application acquires the tablet data block information and the queryed block data block information and stores them to the disk each time the state of the tablet data block changes. Therefore, the state data of the tablet data block can be continuously tracked; the tablet data block information obtained in the real-time manner and the tablet data block information in the root table are verified in multiple dimensions in real time, and timely warning is performed when the verification result is inconsistent. It is beneficial to make timely correction when the tablet data block is disordered and lost, the verification efficiency is high, and the verification result is accurate.
  • FIG. 3 is a data block processing method proposed by the present application.
  • a flow diagram is applied to a system including a storage server, a control server, and a merge server, the method comprising the following steps:
  • step S301 the storage server polls its own log.
  • the step is specifically: when a tablet data block is split or merged on the storage server, a log data is generated to a log file locally stored by the storage server, and the storage server continuously polls the log of the server. , thereby further determining whether the log has new data information.
  • Step S302 when the storage server determines that new data information appears in the log, it is identified whether the new data information is tablet data block information.
  • the step is specifically: when new data information is generated in the storage server log file, the newly generated log data information is acquired, and the newly generated log data information is parsed to identify the new one. Whether the data information is tablet data block information.
  • step S403 If yes, go to step S403; if not, go back to step S401.
  • Step S303 the storage server sends a log carrying the tablet data block information to the control server.
  • control server may perform consistency identification and summary storage according to the tablet data block information carried in the log and the tablet data block information in the root table of the merge server; thereby facilitating subsequent viewing of the oceanbase.
  • the status of the tablet data block in a database under its lifetime is convenient for subsequent automated processing or human processing.
  • the step is specifically: when the newly generated log data includes a tablet data block log, the tablet data block log is reported to the control server, and then the log data generated by the storage server is continuously read;
  • the oceanbase tablet log is encapsulated according to the oceanbase custom log protocol format, and the format includes information about the time when the tablet data block log is generated, the table name corresponding to the tablet data block, and the tablet data block.
  • the reason why oceanbase chooses the log method to record the information of the tablet data block is because the log recorded to the disk has very high reliability. Just like the traditional database uses the redo log and the undo log to realize the data storage, the situation log depends on High reliability.
  • the split or merge operation of the tablet data block in the oceanbase database ends, the oceanbase database will be in the storage where the tablet data block is located.
  • a tablet log is generated on the server, and the log is used to record detailed data of the corresponding block data block splitting or merging, including the boundary, location distribution, check value, index, and the like of the tablet.
  • a tablet log is generated if:
  • Tablet replication When the number of copies of a tablet is less than the threshold, the oceanbase database will select a storage server containing the copy of the tablet as the migration source, and another storage server that meets the requirements as the migration destination, when the tablet copy When migrating from the migration source to the destination, a new copy of the tablet is inevitable at the destination. In this case, the newly generated tablet details are recorded in the storage server log of the destination in the form of a tablet log.
  • Load balancing If the number of tables in a table included in a storage server exceeds a certain threshold, the storage server is used as the migration source, and the other storage server that meets the requirements is the migration destination. Some tables of the table are migrated to the destination. At this time, a new tablet copy will be generated at the destination, and the newly generated tablet detailed information needs to be recorded in the storage server log of the destination in the form of a tablet log.
  • Tablet splitting When merging daily, if a certain table space under a certain table cannot load newly inserted or modified data, the tablet needs to be split into multiple tablets, and the specific split is determined by the amount of data. Tablet, at this time the old tablet changes, and a new tablet is generated. The detailed information of the tablet needs to be recorded in the storage server log of the destination in the form of a tablet log.
  • Combination of tablets When merging daily, if all the data on a tablet under a certain table is deleted, in order to use disk space to the maximum extent, the tablet will be recycled by the oceanbase system, and the tablet will no longer belong to In this table, the tablet details need to be logged in detail to the destination storage server log in the form of a tablet log.
  • the present application can obtain a log carrying tablet data block information in real time, so that the control server compares the tablet data block information carried in the log with the merge server according to the prior art.
  • the table data block information in the root table is consistently identified and summarized, thereby realizing the tracking and accurate verification of the state of the tablet data block.
  • the specific application scenario of this embodiment is in a system including a storage server, a control server, and a merge server.
  • a storage server log parsing daemon is deployed on the storage server, as shown in FIG. 4a, which is a schematic diagram of the storage server log parsing daemon process.
  • the storage server log parsing daemon process is as follows:
  • Step S401 after the log parsing daemon is started, continuously polling the log file generated by the storage server, and reading the log data;
  • Step S402 the log parsing daemon determines whether the storage server log file has new log data generated
  • step S403 If yes, go to step S403; if not, go back to step S401;
  • Step S403 the log parsing daemon parses and obtains new log data, and parses the new log data.
  • Step S404 the log parsing daemon determines whether the new log data contains a log carrying tablet data block information
  • Step S405 the log parsing daemon reports the log carrying the tablet data block information to the control server, and after the reporting ends, the log parsing daemon continues to return the log data generated by the read storage server.
  • control server processes the log. As shown in FIG. 4b, the processing flow of the control server is as follows:
  • Step S406 the control server continuously monitors the log carried by the storage server and carries the tablet data block information, where the tablet data block information includes but is not limited to one or more of the following information: a table name corresponding to the tablet data block, a tablet The boundary corresponding to the data block, the position distribution of the tablet data block, the data check code of the tablet data block, the index of the tablet data block, the creation time of the tablet data block, and the size of the tablet data block;
  • Step S407 the control server determines whether there is a tablet data block reported by the storage server. Log of information;
  • step S408 If yes, go to step S408; if not, go back to step S406;
  • Step S408 the control server receives and parses the log that is carried by the storage server and carries the tablet data block information, and extracts the tablet data block information corresponding to the log, where the tablet data block information includes but is not limited to the following information.
  • the tablet data block information includes but is not limited to the following information.
  • Step S409 the control server queries the table data block information of the root table on the merge server according to the table name corresponding to the tablet data block; wherein, each time the log is received, the table data in the root table is queried once.
  • Block information the merging server to the root table to query the tablet data block information, specifically: by load balancing to connect to the mergeserver server to execute the relevant SQL statement (structured query language) to obtain the table data block information in the root table;
  • Step S410 the control server checks whether the tablet data block carried in the log is consistent with one or more pieces of information corresponding to the tablet data block in the root table: table name, boundary, location distribution, data Check code, index and other information, creation time, size.
  • control server determines that the tablet data block information carried in the log is inconsistent with the tablet data block information in the root table.
  • control server determines that the tablet data block information carried in the log is consistent with the tablet data block information in the root table.
  • step S413 needs to be performed regardless of the result of the determination, and step S414 is also required to be performed when the determination result is inconsistent.
  • Step S411 the control server aggregates the tablet data block information carried in the log and the tablet data block information in the root table.
  • the step is specifically: the control server summarizes the tablet data block information carried in the log and the tablet data block information in the root table; the control server uses the table name corresponding to the tablet data block as the key value.
  • the summarized tablet data block information is persistently saved to the disk, so as to facilitate subsequent viewing of the change status of the tablet data block of a certain table in the oceanbase database during its lifetime;
  • step S412 the control server performs an alarm.
  • the alarm is used to remind the data block information that it is inconsistent, so that it can be processed in time, and it is convenient for subsequent automatic processing or human meat processing.
  • the present application overcomes the defect that the current state can only obtain the current state data of the tablet data block, and cannot continuously track the state change of the tablet data block.
  • the log of the tablet data block information is generated and parsed in real time to obtain the tablet data block information.
  • the tablet data block information is obtained and the query data block information is merged and persistent.
  • the storage is stored in the disk, and the tablet data block information is continuously stored every time the state of the tablet data block changes, so that the tablet data block state change can be continuously tracked; on the other hand, the present application overcomes the prior art adoption.
  • the human flesh search is inefficient in checking, and at the same time, because the log is regularly cleaned, the search results in incomplete log data, which may result in inaccurate verification results.
  • the obtained tablet data block information and the tablet data block information in the root table are verified in multiple dimensions in real time, and timely warning is performed when the verification result is inconsistent, which is beneficial to the disorder of the tablet data block. When it is lost, timely correction is performed, the verification efficiency is high, and the verification result is accurate.
  • the tablet data block information obtained in the embodiment and the table block data block information in the root table obtained by the query are merged and persistently stored, Therefore, in the subsequent verification, the complete data can be obtained, and the accuracy and efficiency of the verification are improved.
  • the embodiment of the present application further provides a processing device for a database data block, which is applied to a system including a storage server, a control server, and a merge server, as shown in FIG. 5 .
  • the device includes:
  • the receiving module 501 is configured to receive a log that is sent by the storage server and carries the data of the tablet data block.
  • the obtaining module 502 is configured to acquire, when the receiving module receives the log that carries the tablet data block information sent by the storage server, the tablet data block information carried in the log;
  • the querying module 503 is configured to use the number of tablets carried in the log obtained by the acquiring module And querying, by the block information, the tablet data block information in the corresponding root table to the merge server;
  • the query module is specifically configured to: determine a table name corresponding to the tablet data block information carried in the log obtained by the acquiring module; and query the merge server The tablet data block information in the root table corresponding to the table name.
  • the determining module 504 is configured to determine whether the tablet data block information carried in the log obtained by the obtaining module is consistent with the tablet data block information in the root table queried by the query module;
  • the determining module is specifically configured to: verify the tablet data block information carried in the log obtained by the acquiring module, and the root queried by the query module. Whether the following one or more pieces of information corresponding to the tablet data block information in the table are consistent: table name, boundary, location distribution, data check code, index, etc., creation time, size;
  • the tablet data block information carried in the log obtained by the obtaining module and the tablet data in the root table queried by the query module are determined.
  • the block information is inconsistent.
  • the processing module 505 is configured to perform summary storage on the tablet data block information carried in the log obtained by the obtaining module and the tablet data block information in the root table queried by the query module, and When the judgment result of the judgment module is inconsistent, an alarm is issued.
  • the processing module is specifically configured to:
  • the table name corresponding to the tablet data block is used as the key value, and the summarized tablet data block information is persistently saved to the disk; thereby facilitating subsequent viewing of the change status of the tablet data block of a certain table in the oceanbase database during its lifetime; Subsequent automated processing or human meat processing.
  • the embodiment of the present application further provides a processing device for a database data block, which is applied to include a storage server, a control server, and a merge.
  • a processing device for a database data block which is applied to include a storage server, a control server, and a merge.
  • the device includes:
  • the polling module 601 is configured to poll the log of the storage server itself
  • the identification module 602 is configured to: when the rotation training module determines that new data information appears in the log, identify whether the new data information is tablet data block information;
  • the sending module 603 is configured to: when the recognition result of the identification module is YES, send a log carrying the tablet data block information to the control server, so that the control server is configured according to the tablet carried in the log
  • the data block information is consistently identified and summarized and stored with the tablet data block information in the root table of the merge server, thereby facilitating subsequent viewing of the change status of the tablet data block of a certain table in the oceanbase database during its lifetime; facilitating subsequent automation Treatment or human meat treatment.
  • the present application can acquire a log of the tablet data block information generated when the tablet data block changes in real time, and analyze the data in real time to obtain the tablet data block information.
  • the example obtains the tablet data block information and the query to obtain the tablet data block information and merges and stores it to the disk, and persistently stores the tablet data block information in each state of the tablet in the disk, so that the state of the tablet data block is continuously tracked.
  • the present application performs the multi-dimensional verification of the obtained tablet data block information and the tablet data block information in the root table in real time, and performs timely warning when the verification result is inconsistent, which is beneficial to When the data block of the tablet is disordered and lost, timely correction is performed, the verification efficiency is high, and the verification result is accurate.
  • the tablet data block information obtained in the embodiment and the table data block information in the root table obtained by the query are obtained, Perform merge and persistent storage, so that the subsequent verification can obtain complete data and improve the calibration standard. Exactness and efficiency.
  • the modules of the device of the present application may be integrated into one or may be deployed separately.
  • the above modules can be combined into one module, or can be further split into multiple sub-modules.
  • modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the description of the embodiments, or the corresponding changes may be located in one or more apparatuses different from the embodiment.
  • the modules of the above embodiments may be combined into one module, or may be further split into multiple sub-modules.
  • the serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
  • the above disclosure is only a few specific embodiments of the present application, but the present application is not limited thereto, and any changes that can be made by those skilled in the art should fall within the protection scope of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种数据块处理方法和设备,该方法包括:当控制服务器接收到存储服务器发送的携带有tablet数据块信息的日志时,获取所述日志中携带的tablet数据块信息;向合并服务器查询root table中的tablet数据块信息;判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致;将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储,若判断结果不一致,则报警。该方法能够持续跟踪tablet数据块的变化状态,高效、精确的校验tablet数据块。

Description

一种数据块处理方法和设备 技术领域
本申请涉及通信技术领域,特别涉及一种数据块处理方法,以及一种数据块的处理设备。
背景技术
随着云计算逐渐变成现实,传统的数据库已经越来越难以支撑云计算下的大数据,在此背景下,分布式数据库得到了迅速发展。作为云计算系统的重要组成部分,分布式数据库越来越成熟,未来将广泛应用于各个行业中,为它们提供低成本、易扩展、高可用的数据存储方案。oceanbase作为当前主流的一种分布式数据库,与其它分布式数据库类似,oceanbase存储引擎的实现方式也是将成千上万台的普通pc服务器的磁盘联合起来进行管理,每台pc服务器中的磁盘被存储引擎划分成了一块块的存储块用于存储数据,即逻辑数据块tablet数据块。在oceanbase数据库中,一个tablet数据块只能属于oceanbase数据库中的某一张表,数据库中的一张表根据数据量的大小可以有多个tablet数据块,即oceanbase数据库中tablet数据块与表的关系是多对一的关系。作为分布式数据库存储引擎的基本存储单元,tablet数据块在pc server上的数量非常巨大,为了保证分布式数据库的高可用性,tablet数据块会有多个副本,即同一份数据会存在于多个tablet数据块上,并且随着时间的推移,数据的插入、删除、更新,以及分布式数据库系统的负载均衡的需要,tablet数据块会有分裂、迁移、合并等等十分复杂的操作,这些操作一旦失败就会带来副本的丢失或者副本间数据的不一致现象。由于大型分布式数据库系统固有的高复杂性,如需要处理数据的一致性、系统的高可用性、分区的容错性等等巨大难题,导致很难控制tablet数据块分布合理性和正确性。
因此,实时的跟踪tablet数据块的变化状态,可以精确的掌握tablet数据块在各个pc server上磁盘上的详细分布情况,从而便于我们分析tablet数据块在各个pc  server上磁盘中的分布的合理性,对于tablet数据块集中分布某些pc server上或者pc sever上的特定磁盘上可以提前进行预警,从而为用户带来额外的业务价值;可以精确的掌握每张表的tablet数据块的分布位置,从而得到每张表在其生存期内tablet数据块的变化状态,为用户提供额外的业务价值;可以对分布式数据库的整个数据存储进行全方面的监控,精确定位数据段的存储位置,从而为用户带来额外的业务价值,除上述之外,实时的跟踪分布式数据库中tablet数据块的变化状态还能带来其他很多的好处。对实时得到的分布式数据库中tablet数据块进行相关校验,可以对tablet数据块中数据不一致的情况及时的进行报警,为后续的自动化或者人肉处理提供依据,防止程序bug导致的tablet数据块的错乱或丢失,将程序bug上报给分布式数据库的开发者,由他们解决该bug,从而进一步提高分布式数据库的稳定性和高可用性。
当前没有现成的方法来跟踪oceanbase数据库中的tablet数据块,一般是在出现tablet数据块丢失或者tablet数据块不一致时人工到oceanbase数据库中查找root table获取到tablet数据块的数据信息来进行跟踪,现有技术由于只是在出现tablet数据块丢失或者tablet数据块不一致时通过人工从oceanbase root table系统表中获取到各个table的tablet数据块信息,而oceanbase root table中存储的各个table的tablet数据块信息只是当前最新的tablet数据块信息,即现有方式只能获取到tablet数据块的当前状态数据,无法持续的跟踪tablet数据块随时间的变换状态。
现有的校验方法是通过人工遍历oceanbase的存储服务器日志获取到tablet数据块相关日志,整合这些日志的信息后与oceanbase root table系统表中对应table的tablet数据块的相关数据进行对比来校验的,通过人工遍历oceanbase的存储服务器的日志,其缺点是效率非常低下;另外为了防止磁盘空间被日志文件大量占用,oceanbase会定期清理一定时间之前的日志,由于日志被清除,导致通过人工遍历oceanbase的存储服务器日志获取到的tablet数据块的日志数据不完整,从而可能导致校验结果不准确的情况。
因此,现有技术一方面无法持续的跟踪tablet数据块随时间的变换状态,另一方面现有技术的校验具有效率非常低下、校验结果不准确的缺点。
发明内容
本申请实施例提供一种数据块处理方法和设备,可以实时的跟踪tablet数据块的变化状态,高效准确的校验tablet数据块信息。
本申请实施例提供一种数据块的处理方法,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
当所述控制服务器接收到所述存储服务器发送的携带有tablet数据块信息的日志时,所述控制服务器获取所述日志中携带的tablet数据块信息;
所述控制服务器根据所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的根表root table中的tablet数据块信息;
所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致;
所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储,并在所述判断结果为不一致时,进行报警。
优选地,所述控制服务器根据所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的root table中的tablet数据块信息,具体包括:
所述控制服务器确定所述日志中携带的tablet数据块信息所对应的表名;
所述控制服务器向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
优选地,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致,具体包括:
所述控制服务器校验所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息所对应的以下一项或多项信息是否一致:
表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小;
当所述校验结果中的任一项不一致时,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息不一致。
优选地,其特征在于,所述控制服务器将所述日志中携带的tablet数据块信息 和所述root table中的tablet数据块信息进行汇总存储,具体包括:
所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总;
所述控制服务器以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上。
本申请实施例提供一种数据块处理方法,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
所述存储服务器轮询自身的日志;
当所述存储服务器确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息;
如果是,所述存储服务器将携带有所述tablet数据块信息的日志发送给所述控制服务器,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储。
本申请实施例提供一种控制服务器,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述控制服务器包括:
接收模块,用于接收所述存储服务器发送的携带有tablet数据块信息的日志;
获取模块,用于在所述接收模块接收到所述存储服务器发送的携带有tablet数据块信息的日志时,获取所述日志中携带的tablet数据块信息;
查询模块,用于根据所述获取模块所获取到的所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的root table中的tablet数据块信息;
判断模块,用于判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息是否一致;
处理模块,用于所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总存储,并在所述判断模块的判断结果为不一致时,进行报警。
优选地,所述查询模块,具体用于:
确定所述获取模块所获取到的所述日志中携带的tablet数据块信息所对应的表名;
向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
优选地,所述判断模块,具体包括:
校验所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息所对应的以下一项或多项信息是否一致:
表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小;
当所述校验结果中的任一项不一致时,判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息不一致。
优选地,所述处理模块,具体包括:
将所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总;
以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上。
本申请实施例提供一种存储服务器,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述存储服务器包括:
轮询模块,用于轮询所述存储服务器自身的日志;
识别模块,用于当所述轮训模块确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息;
发送模块,用于在所述识别模块的识别结果为是时,将携带有所述tablet数据块信息的日志发送给所述控制服务器,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储。
与现有技术相比,本申请至少具有以下优点:本申请可以实时的获取到各个table的tablet数据块随时间的变化状态数据,将获取到的数据持久化存储到磁盘中,依据持久化存储到磁盘中的数据可以描绘出各个table在生存期时间范围内其tablet数据块的状态变化图,达到持续跟踪tablet数据块状态变化的效果,本申请依据得到的tablet数据块相关信息可以实时的对数据库中各个table的tablet数据块进行相关校验,可以实时、高效、准确的预警程序bug产生的tablet数据块的错乱与丢失,从而可以解决现有方案效率非常低下、校验结果不准确的缺点。
附图说明
为了更加清楚地说明本申请实施例的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据本申请实施例的这些附图获得其他的附图。
图1为本申请具体实施例中的数据库的结构示意图;
图2为本申请提出的一种数据块处理方法的流程示意图;
图3为本申请提出的一种数据块处理方法的流程示意图;
图4a为本申请具体实施例中的存储服务器日志解析后台程序流程示意图;
图4b为本申请具体实施例中的控制服务器工作流程示意图;
图5为本申请提出的一种数据库数据块的处理设备的结构示意图;
图6为本申请提出的一种数据库数据块的处理设备的结构示意图。
具体实施方式
为了更加清楚的说明现有技术中所存在的问题,本申请实施例给出了一种数据库的结构图,该数据库例如可以是Oceanbase。具体如图1所示,在具体的应用场景中,针对数据库中的每张表,该数据库使用固定的三层结构来存储其逻辑数据块(tablet数据块)位置信息等元数据,这三层table一起构成系统全部的root table(根表):
A:最右侧为user table(用户表),不属于root table。每个user table按照配置大小在每日合并中分裂成多个tablet,每个tablet存储部分user table的数据,所有tablet分片构成整个user table的所有数据;
B:第三层为user table的元数据表,称为user meta table(用户元数据表)。每个user table对应一个user meta table,user meta table中的一行数据对应于user table中的一个tablet,该行数据存储了user table的tablet边界值、位置分布、校验值、索引等信息等。该user meta table可根据配置大小在每日合并中分裂为多个tablet,每个tablet存储部分的user meta table数据;
C:第二层为user meta table的元数据表,称为user root table(用户根表)。每一行对应第三层中的一个tablet,存储user meta table的tablet边界值、位置分布、校验值、索引信息等。user root table只有一个tablet,且该tablet不允许分裂;
D:第一层是所有user root table的入口,称为first root table(第一根表)。每一行对应第二层中一个user root table,存储user root table所属的tablet边界、位置分布、校验值、索引信息等等。First root table只有一个tablet,且该tablet不允许分裂。
oceanbase数据库中tablet数据块会有多个副本,即同一份数据会存在于多个tablet数据块上,并且随着时间的推移,数据的插入、删除、更新,以及分布式数据库系统的负载均衡的需要,tablet数据块会有分裂、迁移、合并等等十分复杂的操作,这些操作一旦失败就会带来副本的丢失或者副本间数据的不一致现象。因此,实时的跟踪tablet数据块的变化状态,可以达到持续跟踪tablet数据块状态变化的效果,依据得到的tablet数据块相关信息可以实时的对oceanbase中各个table的tablet数据块进行相关校验,可以实时、高效、准确的预警程序bug产生的tablet数据块的错乱与丢失。
但是,现有技术一方面无法持续的跟踪tablet数据块随时间的变换状态,另一方面现有技术的校验具有效率非常低下、校验结果不准确。
为克服现有技术中的缺陷,本申请提出了以下几种具体实施例:
实施例一
为克服现有技术无法持续的跟踪tablet数据块随时间的变换状态,以及校验效率低下、校验结果不准确的缺点。本申请提出了一种数据块处理方法,如图2所示,为本申请提出的一种数据块处理方法的流程示意图,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
步骤S201,当所述控制服务器接收到所述存储服务器发送的携带有逻辑数据块tablet数据块信息的日志时,所述控制服务器获取所述日志中携带的tablet数据块信息。
在本申请优选的实施例中,该步骤具体包括:所述控制服务器接收到来自存储服务器上报的携带有tablet数据块信息的日志,解析所述日志,提取出所述日志对应的tablet数据块信息。
所述tablet数据块信息包括但不限于以下信息中的一种或多种:tablet数据块对应的表名、tablet数据块对应的边界、tablet数据块的位置分布、tablet数据块的数据校验码、tablet数据块的索引等信息、tablet数据块的创建时间、tablet数据块的大小。
步骤S202,所述控制服务器根据所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的根表root table中的tablet数据块信息。
在具体的应用场景中,该步骤的处理流程具体包括:
所述控制服务器确定所述日志中携带的tablet数据块信息所对应的表名;所述控制服务器向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
步骤S203,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致;
在具体的应用场景中,该步骤的处理流程具体包括:
所述控制服务器校验所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息所对应的以下一项或多项信息是否一致:表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小。
当所述校验结果中的任一项不一致时,所述控制服务器判断所述日志中携带 的tablet数据块信息与所述root table中的tablet数据块信息不一致。
反之,当所述校验结果中的全部信息均一致时,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息一致。
在本申请所提出的实施例中,无论判断结果为何种情况,均需要执行步骤S204,并且,在判断结果为不一致时,还需要执行步骤S205。
步骤S204,所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储。
在本申请具体实施例中,该步骤具体包括:所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总;
所述控制服务器以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上;
步骤S205,所述控制服务器进行报警。
通过报警进行数据块信息不一致的提醒,以便及时进行处理。
综上所述,与现有技术相比,本申请在每次tablet数据块的状态发生变化时,都将获取到tablet数据块信息与查询得到tablet数据块信息汇合并持久化存储到磁盘中,从而能持续跟踪tablet数据块状态变化;本申请实时的将得到的tablet数据块信息和root table中的tablet数据块信息进行多维度地校验,并在校验结果不一致时进行了及时的预警,有利于在tablet数据块发生错乱与丢失时,进行及时的修正,校验效率高,校验结果准确。
实施例二
上述说明为本申请在控制服务器侧的实现流程,相应的,本申请还提出了上述技术方案在存储服务器侧的实现流程,如图3所示,为本申请提出的一种数据块处理方法的流程示意图,所述方法应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
步骤S301,所述存储服务器轮询自身的日志。
在本申请具体的实施例中,该步骤具体为:当存储服务器上发生tablet数据块的分裂或者合并,会产生一条日志数据到存储服务器本地的日志文件中,存储服务器不断地轮询自身的日志,从而进一步确定所述日志是否出现新的数据信息。
步骤S302,当所述存储服务器确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息。
在本申请具体的实施例中,该步骤具体为:当存储服务器日志文件有新数据信息产生时,获取到新产生的日志数据信息,对新产生的日志数据信息进行解析,识别所述新的数据信息是否为tablet数据块信息。
如果是,执行步骤S403;如果不是,则返回继续执行步骤S401。
步骤S303,所述存储服务器将携带有所述tablet数据块信息的日志发送给所述控制服务器。
通过本步骤的处理,可以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储;从而方便后续查看oceanbase数据库下某一个表在其生存期内的tablet数据块变化状态;方便后续自动化的处理或者人肉处理。
在本申请具体的实施例中,该步骤具体为:当新产生的日志数据中含有tablet数据块日志,将所述tablet数据块日志上报给控制服务器,之后继续读取存储服务器产生的日志数据;
当无新日志产生或者产生的日志不是tablet数据块日志,则返回继续读取存储服务器产生的日志数据。
在具体的应用场景中,oceanbase的tablet日志按照oceanbase自定的日志协议格式进行封装,该格式包含的信息有tablet数据块日志产生的时间,该tablet数据块对应的表名,该tablet数据块的边界,该tablet数据块的校验码,该tablet数据块的位置分布等等信息。oceanbase之所以选择日志的方式来记录tablet数据块的信息,是因为记录到磁盘的日志具有非常高的可靠性,正如传统数据库以redo日志和undo日志来实现数据的存储一样,依靠的局势日志的高可靠性。当oceanbase数据库中tablet数据块的分裂或者合并动作结束时oceanbase数据库均会在tablet数据块所在的存储 服务器上产生一条tablet日志,该日志用于记录对应tablet数据块分裂或者合并时的详细数据,包括tablet的边界、位置分布、校验值、索引等信息。有如下情况会产生tablet日志:
tablet复制:当某个tablet的副本数小于阀值时,oceanbase数据库会选择一台包含该tablet副本的存储服务器作为迁移源,另一台符合要求的存储服务器作为迁移目的地,当将该tablet副本从迁移源迁移到目的地时,必然会在目的地产生新的tablet副本,此时需要将新产生的tablet详细信息以tablet日志的方法详细记录到目的地的存储服务器日志中。
负载均衡:如果某台存储服务器包含的某个表的tablet个数超过某个阈值,则以这台存储服务器为迁移源,另一台符合要求的存储服务器为迁移目的地,将迁移源下该表的一些tablet迁移至目的地,此时也必然会在目的地产生新的tablet副本,也需要将新产生的tablet详细信息以tablet日志的方法详细记录到目的地的存储服务器日志中。
tablet分裂:每日合并时,如果某张表下属的某个tablet的空间无法装下新插入或者修改的数据,则需要将该tablet分裂为多个tablet,通过数据量来确定具体分裂为几个tablet,此时老tablet发生改变,同时产生了新tablet,需要将tablet详细信息以tablet日志的方法详细记录到目的地的存储服务器日志中。
tablet合并:每日合并时,如果某张表下属的某个tablet上的数据全部被删除,则为了最大限度的高效使用磁盘空间,该tablet会被oceanbase系统回收,此时该tablet将不再属于该表了,需要将tablet详细信息以tablet日志的方法详细记录到目的地的存储服务器日志中。
综上所述,与现有技术相比,本申请能够实时的获取携带有tablet数据块信息的日志,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储,从而实现对tablet数据块状态的跟踪和准确校验。
实施例三
为了进一步阐述本申请的技术方案,现结合具体的应用场景,对本申请的技术方案进行说明,本实施例的具体的应用场景为在包括存储服务器、控制服务器和合并服务器的系统中,本实施例在存储服务器上部署一个存储服务器日志解析后台程序,如图4a所示,为本申请存储服务器日志解析后台程序流程示意图;所述存储服务器日志解析后台程序流程如下:
步骤S401,日志解析后台程序启动后不断的轮询存储服务器产生的日志文件,读取日志数据;
步骤S402,所述日志解析后台程序判断存储服务器日志文件是否有新的日志数据产生;
如果是,执行步骤S403;如果不是,则返回继续执行步骤S401;
步骤S403,所述日志解析后台程序解析获取到新的日志数据,对新的日志数据进行解析;
步骤S404,所述日志解析后台程序判断所述新的日志数据中是否含有携带tablet数据块信息的日志;
步骤S405,所述日志解析后台程序将所述携带tablet数据块信息的日志上报给控制服务器,上报结束后所述日志解析后台程序继续返回读取存储服务器产生的日志数据。
进一步,所述日志解析后台程序将所述携带tablet数据块信息的日志上报给控制服务器后,所述控制服务器对所述日志进行处理,如图4b所示,所述控制服务器的处理流程如下:
步骤S406,控制服务器持续监听来自存储服务器上报的携带有tablet数据块信息的日志,所述tablet数据块信息包括但不限于以下信息中的一种或多种:tablet数据块对应的表名、tablet数据块对应的边界、tablet数据块的位置分布、tablet数据块的数据校验码、tablet数据块的索引等信息、tablet数据块的创建时间、tablet数据块的大小;
步骤S407,所述控制服务器判断是否有存储服务器上报的携带有tablet数据块 信息的日志;
如果是,执行步骤S408;如果不是,则返回继续执行步骤S406;
步骤S408,所述控制服务器接收并解析所述存储服务器上报的携带有tablet数据块信息的日志,提取出该日志对应的tablet数据块信息,所述tablet数据块信息包括但不限于以下信息中的一种或多种:tablet数据块对应的表名、tablet数据块对应的边界、tablet数据块的位置分布、tablet数据块的数据校验码、tablet数据块的索引等信息、tablet数据块的创建时间、tablet数据块的大小;
步骤S409,所述控制服务器根据所述tablet数据块对应的表名通过在合并服务器上查询出root table的tablet数据块信息;其中,每接收到一条所述日志就查询一次root table中的tablet数据块信息;所述通过合并服务器到root table中查询tablet数据块信息,具体为:通过负载均衡的方式连接到该mergeserver服务器执行相关sql语句(结构化查询语言)获取root table中tablet数据块信息;
步骤S410,所述控制服务器校验所述日志中携带的tablet数据块与所述root table中的tablet数据块所对应的以下一项或多项信息是否一致:表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小。
当所述校验结果中的任一项不一致时,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息不一致。
反之,当所述校验结果中的全部信息均一致时,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息一致。
在本申请所提出的实施例中,无论判断结果为何种情况,均需要执行步骤S413,并且,在判断结果为不一致时,还需要执行步骤S414。
步骤S411,所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储。该步骤具体为:所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总;所述控制服务器以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上,从而方便后续查看oceanbase数据库下某一个表在其生存期内的tablet数据块变化状态;
步骤S412,所述控制服务器进行报警。通过报警进行数据块信息不一致的提醒,以便及时进行处理,并方便后续自动化的处理或者人肉处理。
综上所述,与现有技术相比,一方面,本申请克服了现有方式只能获取到tablet数据块的当前状态数据,不能持续跟踪tablet数据块状态变化的缺陷,本申请实时地获取tablet数据块变化时产生地携带有tablet数据块信息的日志,并对其进行实时地解析,得到tablet数据块信息,本实施例将获取到tablet数据块信息与查询得到tablet数据块信息汇合并持久化存储到磁盘中,由于对每次tablet数据块的状态发生变化时的tablet数据块信息进行持久化存储,从而能够持续跟踪tablet数据块状态变化;另一方面,本申请克服了现有技术通过人肉搜索进行校验效率低下,同时由于日志被定期清理,造成搜索得到日志数据不完整,从而可能导致校验结果不准确的缺陷。本申请实时的将得到的tablet数据块信息与root table中的tablet数据块信息进行了多维度地校验,并在校验结果不一致时进行了及时的预警,有利于在tablet数据块发生错乱与丢失时,进行及时的修正,校验效率高,校验结果准确,同时,由于本实施例还对得到地tablet数据块信息和查询得到的root table中的tablet数据块信息进行汇合并持久化存储,从而在后续的校验能够获得完整的数据,提高校验地准确度和效率。
实施例四
基于与上述数据块处理方法实现流程同样的申请构思,本申请实施例中还提供了一种数据库数据块的处理设备,应用于包括存储服务器、控制服务器和合并服务器的系统中,如图5所示,所述设备包括:
接收模块501,用于接收所述存储服务器发送的携带有tablet数据块信息的日志;
获取模块502,用于在所述接收模块接收到所述存储服务器发送的携带有tablet数据块信息的日志时,获取所述日志中携带的tablet数据块信息;
查询模块503,用于根据所述获取模块所获取到的所述日志中携带的tablet数 据块信息,向所述合并服务器查询相对应的root table中的tablet数据块信息;
在本申请具体的实施例中,所述查询模块,具体用于:确定所述获取模块所获取到的所述日志中携带的tablet数据块信息所对应的表名;向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
判断模块504,用于判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息是否一致;
在本申请具体的实施例中,所述判断模块,具体用于:校验所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息所对应的以下一项或多项信息是否一致:表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小;
当所述校验结果中的任一项不一致时,判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息不一致。
处理模块505,用于所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总存储,并在所述判断模块的判断结果为不一致时,进行报警。
在本申请具体的实施例中,所述处理模块,具体用于:
将所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总;
以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上;从而方便后续查看oceanbase数据库下某一个表在其生存期内的tablet数据块变化状态;方便后续自动化的处理或者人肉处理。
实施例五
基于与上述数据块处理方法实现流程同样的申请构思,本申请实施例中还提供了一种数据库数据块的处理设备,应用于包括存储服务器、控制服务器和合并 服务器的系统中,如图6所示,所述设备包括:
轮询模块601,用于轮询所述存储服务器自身的日志;
识别模块602,用于当所述轮训模块确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息;
发送模块603,用于在所述识别模块的识别结果为是时,将携带有所述tablet数据块信息的日志发送给所述控制服务器,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储,从而方便后续查看oceanbase数据库下某一个表在其生存期内的tablet数据块变化状态;方便后续自动化的处理或者人肉处理。
综上所述,与现有技术相比,本申请能够实时地获取tablet数据块变化时产生地携带有tablet数据块信息的日志,并对其进行实时地解析,得到tablet数据块信息,本实施例将获取到tablet数据块信息与查询得到tablet数据块信息汇合并持久化存储到磁盘中,持久化存储到磁盘中tablet各个状态地tablet数据块信息,所以达到了持续跟踪tablet数据块状态变化的效果;另一方面,本申请实时的将得到的tablet数据块信息与root table中的tablet数据块信息进行了多维度地校验,并在校验结果不一致时进行了及时的预警,有利于在tablet数据块发生错乱与丢失时,进行及时的修正,校验效率高,校验结果准确,同时,由于本实施例还对得到地tablet数据块信息和查询得到的root table中的tablet数据块信息进行汇合并持久化存储,从而在后续的校验能够获得完整的数据,提高校验地准确度和效率。
其中,本申请装置的各个模块可以集成于一体,也可以分离部署。上述模块可以合并为一个模块,也可以进一步拆分成多个子模块。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上 或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。本领域技术人员可以理解附图只是一个优选实施例的示意图,附图中的模块或流程并不一定是实施本申请所必须的。本领域技术人员可以理解实施例中的装置中的模块可以按照实施例描述进行分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上公开的仅为本申请的几个具体实施例,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (10)

  1. 一种数据块处理方法,其特征在于,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
    当所述控制服务器接收到所述存储服务器发送的携带有逻辑数据块tablet数据块信息的日志时,所述控制服务器获取所述日志中携带的tablet数据块信息;
    所述控制服务器根据所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的根表root table中的tablet数据块信息;
    所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致;
    所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储,并在所述判断结果为不一致时,进行报警。
  2. 如权利要求1所述的方法,其特征在于,所述控制服务器根据所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的root table中的tablet数据块信息,具体包括:
    所述控制服务器确定所述日志中携带的tablet数据块信息所对应的表名;
    所述控制服务器向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
  3. 如权利要求1所述的方法,其特征在于,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息是否一致,具体包括:
    所述控制服务器校验所述日志中携带的tablet数据块与所述root table中的tablet数据块所对应的以下一项或多项信息是否一致:
    表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小;
    当所述校验结果中的任一项不一致时,所述控制服务器判断所述日志中携带的tablet数据块信息与所述root table中的tablet数据块信息不一致。
  4. 如权利要求1所述的方法,其特征在于,所述控制服务器将所述日志中携 带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总存储,具体包括:
    所述控制服务器将所述日志中携带的tablet数据块信息和所述root table中的tablet数据块信息进行汇总;
    所述控制服务器以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上。
  5. 一种控制服务器,其特征在于,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述控制服务器包括:
    接收模块,用于接收所述存储服务器发送的携带有tablet数据块信息的日志;
    获取模块,用于在所述接收模块接收到所述存储服务器发送的携带有tablet数据块信息的日志时,获取所述日志中携带的tablet数据块信息;
    查询模块,用于根据所述获取模块所获取到的所述日志中携带的tablet数据块信息,向所述合并服务器查询相对应的root table中的tablet数据块信息;
    判断模块,用于判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息是否一致;
    处理模块,用于所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总存储,并在所述判断模块的判断结果为不一致时,进行报警。
  6. 如权利要求5所述的控制服务器,其特征在于,所述查询模块,具体用于:
    确定所述获取模块所获取到的所述日志中携带的tablet数据块信息所对应的表名;
    向所述合并服务器查询所述表名所对应的root table中的tablet数据块信息。
  7. 如权利要求5所述的控制服务器,其特征在于,所述判断模块,具体包括:
    校验所述获取模块所获取到的所述日志中携带的tablet数据块与所述查询模块所查询到的所述root table中的tablet数据块所对应的以下一项或多项信息是否一致:
    表名、边界、位置分布、数据校验码、索引等信息、创建时间、大小;
    当所述校验结果中的任一项不一致时,判断所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息不一致。
  8. 如权利要求5所述的控制服务器,其特征在于,所述处理模块,具体包括:
    将所述获取模块所获取到的所述日志中携带的tablet数据块信息与所述查询模块所查询到的所述root table中的tablet数据块信息进行汇总;
    以tablet数据块对应的表名作为key值,将汇总后的tablet数据块信息持久化保存到磁盘上。
  9. 一种数据块处理方法,其特征在于,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述方法包括以下步骤:
    所述存储服务器轮询自身的日志;
    当所述存储服务器确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息;
    如果是,所述存储服务器将携带有所述tablet数据块信息的日志发送给所述控制服务器,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储。
  10. 一种存储服务器,其特征在于,应用于包括存储服务器、控制服务器和合并服务器的系统中,所述存储服务器包括:
    轮询模块,用于轮询所述存储服务器自身的日志;
    识别模块,用于当所述轮训模块确定所述日志出现新的数据信息时,识别所述新的数据信息是否为tablet数据块信息;
    发送模块,用于在所述识别模块的识别结果为是时,将携带有所述tablet数据块信息的日志发送给所述控制服务器,以使所述控制服务器根据所述日志中携带的tablet数据块信息与所述合并服务器的root table中的tablet数据块信息进行一致性识别和汇总存储。
PCT/CN2016/073594 2015-02-27 2016-02-05 一种数据块处理方法和设备 WO2016134639A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US15/553,050 US20180032567A1 (en) 2015-02-27 2016-02-05 Method and device for processing data blocks in a distributed database
EP16754748.8A EP3264291A4 (en) 2015-02-27 2016-02-05 Data block processing method and device
JP2017544648A JP6633642B2 (ja) 2015-02-27 2016-02-05 分散データベースにおけるデータブロックを処理する方法およびデバイス

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510090139.4 2015-02-27
CN201510090139.4A CN105989140B (zh) 2015-02-27 2015-02-27 一种数据块处理方法和设备

Publications (1)

Publication Number Publication Date
WO2016134639A1 true WO2016134639A1 (zh) 2016-09-01

Family

ID=56787904

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073594 WO2016134639A1 (zh) 2015-02-27 2016-02-05 一种数据块处理方法和设备

Country Status (5)

Country Link
US (1) US20180032567A1 (zh)
EP (1) EP3264291A4 (zh)
JP (2) JP6633642B2 (zh)
CN (1) CN105989140B (zh)
WO (1) WO2016134639A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10409768B2 (en) * 2016-09-30 2019-09-10 EMC IP Holding Company LLC Managing data inconsistencies in files of file systems
CN108549704B (zh) * 2018-04-18 2021-01-12 厦门市美亚柏科信息股份有限公司 数据包的分布式流式预处理方法、装置、设备及可读介质
CN110019247A (zh) * 2018-08-16 2019-07-16 比亚迪股份有限公司 数据存储以及查询方法、装置和监控系统
CN111061721B (zh) * 2018-10-16 2023-07-25 成都鼎桥通信技术有限公司 数据处理方法及装置
CN111290714B (zh) * 2020-02-06 2023-09-05 北京百度网讯科技有限公司 数据读取方法和装置
CN114168572A (zh) * 2022-02-10 2022-03-11 北京奥星贝斯科技有限公司 管理数据库的方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567445A (zh) * 2011-10-25 2012-07-11 无锡城市云计算中心有限公司 一种分布式文件系统中保证元数据一致性的方法
US20120303631A1 (en) * 2011-05-24 2012-11-29 Red Lambda, Inc. System and Method for Storing Files in a Distributed Environment
CN104331478A (zh) * 2014-11-05 2015-02-04 浪潮电子信息产业股份有限公司 一种自精简存储系统数据一致性管理方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3612449B2 (ja) * 1999-07-27 2005-01-19 エヌイーシーシステムテクノロジー株式会社 分散データベースシステムにおける主従関係情報同期方式
JP4137391B2 (ja) * 2001-02-19 2008-08-20 株式会社リコー データ管理装置、方法、プログラム、及び記録媒体
CN102156738B (zh) * 2011-04-13 2012-12-19 成都市华为赛门铁克科技有限公司 数据块处理方法、数据块存储设备及系统
CN103778030B (zh) * 2013-12-30 2017-09-22 上海晨思电子科技有限公司 日志子系统写入方法、错误追踪方法及处理器
CN103929500A (zh) * 2014-05-06 2014-07-16 刘跃 一种分布式存储系统的数据分片方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120303631A1 (en) * 2011-05-24 2012-11-29 Red Lambda, Inc. System and Method for Storing Files in a Distributed Environment
CN102567445A (zh) * 2011-10-25 2012-07-11 无锡城市云计算中心有限公司 一种分布式文件系统中保证元数据一致性的方法
CN104331478A (zh) * 2014-11-05 2015-02-04 浪潮电子信息产业股份有限公司 一种自精简存储系统数据一致性管理方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3264291A4 *

Also Published As

Publication number Publication date
JP6996812B2 (ja) 2022-01-17
CN105989140B (zh) 2019-09-03
CN105989140A (zh) 2016-10-05
EP3264291A1 (en) 2018-01-03
EP3264291A4 (en) 2018-10-03
JP6633642B2 (ja) 2020-01-22
JP2020057416A (ja) 2020-04-09
US20180032567A1 (en) 2018-02-01
JP2018511861A (ja) 2018-04-26

Similar Documents

Publication Publication Date Title
WO2016134639A1 (zh) 一种数据块处理方法和设备
US11442823B2 (en) Transaction consistency query support for replicated data from recovery log to external data stores
CN106815326B (zh) 一种检测无主键数据表一致性的系统及方法
US10210190B1 (en) Roll back of scaled-out data
US9152353B1 (en) Verifying the consistency of slice allocation metadata
CN110362455B (zh) 一种数据处理方法和数据处理装置
US9372765B2 (en) System and method for recovering system status consistently to designed recovering time point in distributed database
WO2023103626A1 (zh) 数据降采样和数据查询方法、系统及存储介质
CN111221890B (zh) 通用指标类自动监控预警方法及装置
CN112306700A (zh) 一种异常rpc请求的诊断方法和装置
US20150281037A1 (en) Monitoring omission specifying program, monitoring omission specifying method, and monitoring omission specifying device
WO2012101531A1 (en) Data integrity protection in storage volumes
CN107004036B (zh) 用以搜索包含大量条目的日志的方法和系统
CN110717130A (zh) 打点方法、装置、终端及存储介质
CN110309206B (zh) 订单信息采集方法及系统
CN102779134B (zh) 基于Lucene的分布式搜索方法
CN108334524A (zh) 一种storm日志错误分析方法及装置
WO2022262613A1 (zh) 一种数据完整性处理方法、装置及电子设备
US20130290385A1 (en) Durably recording events for performing file system operations
CN115185778A (zh) 数据库的监控方法及装置
CN108681495A (zh) 一种坏块修复方法及装置
CN113778996A (zh) 一种大数据流数据处理方法、装置、电子设备及存储介质
CN116628042A (zh) 数据处理方法、装置、设备及介质
CN105205168A (zh) 一种基于Redis数据库的曝光系统及其操作方法
US10552387B1 (en) Managing data using a simulation of purging

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16754748

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2017544648

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2016754748

Country of ref document: EP