Ptubes is a database disaster recovery product based on the PITR (Point In Time Recovery) method

Related tags

Spring Boot ptubes
Overview

Introduction

License


EN doc CN doc


Ptubes is a database disaster recovery product based on PITR (Point In Time Recovery), which can be used to restore the entire database to a specific point in time to help users improve the reliability and security of the database. The product consists of three core components, Reader, Storage and SDK. It provides functions such as safe backup and efficient distribution of database change events. Typical scenarios are as follows:

  • data backup
  • Data playback
  • Data Recovery
  • Event driven
  • The database is more active

Quick Start

Prerequisite

  • 64bit JDK 1.8+

  • Maven 3.2.x

Run Reader

1.mysql preparation
Ptubes synchronization data requires mysql to support Binlog ROW mode in advance, users need to modify the binlog mode in advance

[mysqld]

log-bin=mysql-bin # Open binlog

binlog-format=ROW # Modify to ROW mode

2.Start Reader
2.1.Download the compressed package
ptubes-reader-server.tar.gz

2.2.Unzip to any directory

mkdir /user/ptubes
tar zxvf ptubes-reader-server.tar.gz -C /tmp/ptubes

After decompression, you can see the directory structure

drwxr-xr-x   4 yangmouren  staff   128  2 17 16:47 bin
drwxr-xr-x   5 yangmouren  staff   160  2 17 16:54 conf
drwxr-xr-x  63 yangmouren  staff  2016  2 17 17:00 lib

2.3.Modify related configuration information In the conf directory, modify a reader.conf and fill in the configuration

ptubes.server.tasks=demoR1,demoR2 //Task name, each task needs to have configuration information of the corresponding file, separated by commas

The program will continue to read the ReaderTask related configuration according to the parameters of ptubes.server.tasks. Take the above picture as an example, the program will automatically search for demoR1.properties and demoR2.properties from the current directory, and we will create corresponding files respectively (as shown in the following figure)

ptubes.reader.mysql.host= //mysql host address
ptubes.reader.mysql.port= //mysql port
ptubes.reader.mysql.user= //mysql username
ptubes.reader.mysql.passwd= //mysql password

Then run the program to start the ptubes exploration journey.

2.4.Start the service

sh bin/start.sh

2.5.View service log

tail -f logs/reader.log

2.6.Shut down the service

sh bin/stop.sh

Start the SDK

SDK start

more configuration

configuration document

Documentation

License

Apache License, Version 2.0 Copyright (C) Apache Software Foundation

issues

Ptubes ISSUES

Comments
  • [BUG]Special time fields, parsing will encounter problems

    [BUG]Special time fields, parsing will encounter problems

    Environment

    • Ptubes version: 1.0.0
    • Operating System version: Linux
    • Java version: 1.8

    Steps to reproduce this issue

    In some cases in our business, there will be some special time fields, for example: the time field value is "-838:59:59.000000", the datetime field value is "9999-12-31 23:59:59.999999", these special After the time field is delivered to the downstream, the precision and value are different from the upstream

    Expected Behavior

    The value of the downstream data is the same as the value of the upstream database, regardless of whether it is a special time field value

    Actual Behavior

    The field value of datetime is "9999-12-31 23:59:59.999999", and the precision of synchronization to the target table becomes 3 digits The value of the time field is "-838:59:59.000000", the value of the upstream table is: -35 days, 1:00:01, after delivery to the downstream, it becomes: 17:04:05

    bug 
    opened by myksl 2
  • [BUG]If the upstream database goes down, the Disruptor will leak threads

    [BUG]If the upstream database goes down, the Disruptor will leak threads

    Environment

    • Ptubes version: 1.0.0
    • Operating System version: Linux
    • Java version: 1.8

    Steps to reproduce this issue

    If the upstream database goes down, the readerTask will always try to reconnect. The Disruptor created during this process cannot be recycled normally, which will cause the Disruptor thread to leak, resulting in the creation of a large number of useless threads.

    Expected Behavior

    The thread is recycled normally during the retry process

    Actual Behavior

    The thread is not recycled properly

    bug 
    opened by myksl 2
  • [BUG]Data parsing error, resulting in data loss

    [BUG]Data parsing error, resulting in data loss

    Environment

    • Ptubes version: 1.0.0
    • Operating System version: Linux
    • Java version: 1.8

    Steps to reproduce this issue

    I have a problem. When my upstream database changes greatly, I will encounter errors and lose data. The server log is as follows

    b2bssc-3 parse row data error, skip row data at txn = TxnContext[], row = RowContext[table=xxx,type=UPDATE] com.meituan.ptubes.reader.common.exception.BuffaloException: java.lang.IndexOutOfBoundsException: Index: 0
    
    

    Expected Behavior

    Data can be parsed and stored normally

    Actual Behavior

    Data parsing error, it seems that only the update type will have problems

    bug 
    opened by myksl 1
  • [fix time parse]#3

    [fix time parse]#3

    What is the purpose of the change

    fix bug https://github.com/meituan/ptubes/issues/3

    Brief Changelog

    There will be problems with the parsing of special time types. This time, we have made special parsing for special times.

    Verify this change

    • [x] Make sure there is a GitHub_issue field for changes (usually before you start working on it). Trivial changes like spelling mistakes do not require GitHub issues. Your pull request should only address this issue and no other changes - one PR addresses one issue.
    • [x] Every commit in a pull request should have a meaningful subject line and body.
    • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    • [x] Write the necessary unit tests to verify your logic corrections, mocks work better when there are cross-module dependencies.
    • [x] GitHub Actions works fine on your own fork.
    opened by myksl 0
  • [fix data parsing error]#2

    [fix data parsing error]#2

    What is the purpose of the change

    bug fix https://github.com/meituan/ptubes/issues/2

    Brief Changelog

    In BinlogContextParser, there are two context variables that should be thread-private, but they are shared during processing, causing concurrency problems. This modification gives them a clone

    Verify this change

    • [x] Make sure there is a GitHub_issue field for changes (usually before you start working on it). Trivial changes like spelling mistakes do not require GitHub issues. Your pull request should only address this issue and no other changes - one PR addresses one issue.
    • [x] Every commit in a pull request should have a meaningful subject line and body.
    • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    • [x] Write the necessary unit tests to verify your logic corrections, mocks work better when there are cross-module dependencies.
    • [x] GitHub Actions works fine on your own fork.
    opened by myksl 0
  • [fix Disruptor leak threads]#1

    [fix Disruptor leak threads]#1

    What is the purpose of the change

    fix issuse https://github.com/meituan/ptubes/issues/1

    Brief Changelog

    The startup of BinlogPipeline is divided into two steps. The first step is to initialize some resources. Only after the database is successfully linked, will BinlogPipeline be started and the thread initialized to avoid thread leakage.

    Verify this change

    • [x] Make sure there is a GitHub_issue field for changes (usually before you start working on it). Trivial changes like spelling mistakes do not require GitHub issues. Your pull request should only address this issue and no other changes - one PR addresses one issue.
    • [x] Every commit in a pull request should have a meaningful subject line and body.
    • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    • [x] Write the necessary unit tests to verify your logic corrections, mocks work better when there are cross-module dependencies.
    • [x] GitHub Actions works fine on your own fork.
    opened by myksl 0
  • [BUG]When the task is running, an error in the upstream database will cause the task to freeze

    [BUG]When the task is running, an error in the upstream database will cause the task to freeze

    Environment

    • Ptubes version: 1.0.0
    • Operating System version: Linux
    • Java version: 1.8

    Steps to reproduce this issue

    I encountered a problem. When my database crashes, it is normal to retry and reconnect to the database, but I observed that the task shutdown resource will retry to connect to the database, and the Producer thread is waiting on a condition.

    Expected Behavior

    It is normal to expect that the database can automatically reconnect and continue the data flow after the database is disconnected

    Actual Behavior

    The database could not be reconnected and the data flow was interrupted

    opened by myksl 0
  • [bug]Can not subscribe a table with a column type of geometry

    [bug]Can not subscribe a table with a column type of geometry

    Environment

    • Ptubes version: 1.0.0

    • Operating System version: Linux

    • Java version: 1.8

    Steps to reproduce this issue

    Subscribe a table with a column type of geometry.

    Expected Behavior

    Reader can subscribe successfully and sdk can receive the data.

    Actual Behavior

    Reader parse binlog event error and skip the event.

    bug 
    opened by lvfeifei08 0
  • [Feature]Hope ptubes can support transaction sending data, support ACID

    [Feature]Hope ptubes can support transaction sending data, support ACID

    Describe the feature

    At present, ptubes does not support transaction sending data. All binlog events strip the transaction concept and are all delivered in the form of Events, resulting in the loss of ACID attributes.

    When the industry observes the downstream library, half of the upstream operations in the same transaction may be observed: for example, the order placement process, the intra-transaction operation to create an order, and the deduction of the balance. It was originally an intra-transaction operation, with atomicity and synchronization through ptubes When going downstream, the business may observe that the balance has not changed, an order has been added / the balance has decreased, and there is no corresponding order

    So we expect that ptubes can assemble the binlog into a transaction and restore the ACID attribute. Some of our functions require this ability

    feature 
    opened by myksl 0
  • [Feature]Hope ptubes can support storage layer partition

    [Feature]Hope ptubes can support storage layer partition

    Describe the feature

    At present, the concept of sharding is a logical concept, which only exists in the Client for parallel consumption. As a result, each Reader needs to pull the full binlog, and there is a visible performance upper limit for pulling and storing (cannot scale linearly)

    1. From logical sharding to physical sharding, the concept of partition is introduced, each Reader does not need to pull all binlogs, reducing storage and processing pressure, and at the same time supporting parallel processing of data by Reader (each Reader processes a part of the partition), improving ptubes Scalability
    2. The data of each partition can be subscribed separately to reduce the data backtracking when the service is duplicated
    3. Each partition has a separate writing thread, effectively breaking through the performance bottleneck of single-threaded sequential writing
    feature 
    opened by myksl 0
  • [Feature]It is recommended that ptubes support the separation of storage and computation

    [Feature]It is recommended that ptubes support the separation of storage and computation

    Describe the feature

    I recently encountered a problem. Our business has some tasks with relatively large traffic, which will write a large amount of data. At the same time, because of business characteristics, we expect the data to be stored for a long time, which will cause our disk usage to be relatively high. In extreme cases will cause disk exhaustion So, I hope to have a new ability

    1. Added a new StorageMode inside Reader, which supports S3 remote storage + Memory mode, and supports tiered storage
    2. Support Binlog persistent storage
    3. The real-time consumption stream maintains the same speed as before
    4. The local disk will be used as the real-time data layer, S3 will be used as the persistent storage layer, and the non-latest data of the local disk will be asynchronously written to S3 through certain rules
    feature 
    opened by myksl 0
Owner
美团 Meituan
美团技术团队官方账号,部分项目也可以访问:https://github.com/meituan-dianping 。
美团 Meituan
SBSRE is an eclipse plugin for extract method refactoring based on the single responsibility principle(SRP)

SBSRE is a slice-based single responsibility extraction approach supported by an eclipse plugin for identifying Single responsibility violations in the methods.

null 4 Jul 8, 2022
This repository contains the source code for a Product Comparison solution

Product Comparison Installation Guide This repository contains the source code for a Product Comparison solution. Please report any issues here. Insta

Mărgărit Marian Cătălin 8 Dec 5, 2022
Example usage of work manager in Android, while doing this study, image downloading was preferred as a method.

android-workmanager-example Example usage of work manager in Android, while doing this study, image downloading was preferred as a method. Java 11 com

Adil Çetin 1 Jan 29, 2022
A simple tool to get method stack

A simple tool to get method stack

赵元超 2 Jan 17, 2022
FEM for Students is a program of modeling and structural analysis by Finite Element Method

FEM For Students FEM for Students is a software for modeling and structural analysis by Finite Element Method. This software was developed by me in my

André de Sousa 4 Jun 23, 2022
PluginHooker is a Bukkit plugin that aims to provide an ultimately simple and better method to hook Bukkit events.

PluginHooker PluginHooker is a Bukkit plugin that aims to provide an ultimately simple and better method to hook Bukkit events. Localization 简体中文 Feat

null 12 Nov 23, 2022
This project uses the artificial potential field method to realize the path planning of the robot, and completes the trajectory optimization through other settings. It can also be combined with laser SLAM, target recognition and other technologies for path planning.

FRCAutoDriver 项目说明 Project Instruction 本项目利用人工势场法,实现机器人的路径规划,并通过其他设置完成轨迹优化,还可以结合激光SLAM、目标识别等技术进行路径规划 This project uses the artificial potential field

ZhangzrJerry 2 Sep 9, 2022
Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in.

JoinMessages Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in or leave.

ᴠᴀʟᴇɴᴛɪɴ ᴢʜᴇʟᴇᴠ 6 Aug 30, 2022
Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects.

Just-In-Time Access Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects. Syno

Google Cloud Platform 36 Jan 3, 2023
Relational database project, PC Builder, for the Database Systems Design course.

README: Starting the Progam: This program was built and ran on the Eclipse IDE. To run, first create the database, "ty_daniel_db", using the ty_dani

Daniel Ty 1 Jan 6, 2022
This is a database system, completely based on java!

AstralPathSQL Creator BestLoveForYou website:website email:[email protected] 2022-07-17 0:4 Beijing time Brief Introduction: This is a database syst

茸 2 Jul 16, 2022
This app/widget is based on the work of Anthony (tonesto7), which is in turn based on the earlier work of David Schablowsky

Mustang Mach-E Widget for Android Intro This app/widget is based on the work of Anthony (tonesto7), which is in turn based on the earlier work of Davi

null 25 Nov 15, 2022
Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

null 4 Oct 4, 2022
A Text Based, Turn-Based, Strategy Game to be played in console

ConsoleGame A Text Based, Turn-Based, Strategy Game to be played in console. Feel free to fix any retardation in my code (meaning bugs, stupid/spaghet

Bertrahm 2 Jul 17, 2022
Person Apri development in real time

Digital Innovation: Expert class - Desenvolvendo um sistema de gerenciamento de pessoas em API REST com Spring Boot Nesta live coding vamos desenvolve

Vitor Nunes 1 Nov 11, 2021
COMPortNotifier - Smol utility to send you a notification every time you connect, or disconnect a COM port.

COMPortNotifier A smol utility that sends you a notification every time a COM port is connected, or disconnected on your computer. Useful for electric

Matt Foulks 1 Sep 7, 2022
AlarmManager (Wobble) is a time management application that helps you wake up

AlarmManager AlarmManager (Wobble) is a time management application that helps you wake up | | | The app has following features: Alarm: Vocal message

Piyush Shrivastava 1 Jan 8, 2022
Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Spring controller interface

Restler Overview Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Sprin

Excelsior LLC 29 Oct 24, 2022
This app corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair 실시간 자세분석 및 교정 스마트체어 ?? 상명대학교 PRIME 경진대회 수상 ?? 요구사항 31-cell sensor (mdxs-16-5610) 목차 1. 소개 프로젝트 내용 소개 2. 개발 환경 사전 설정 및 환경 구축 3. 기능 Sensors Ap

Minuk_LEE 3 Jan 15, 2022