@clickup/pg-microsharding
Version:
Microshards support for PostgreSQL
27 lines • 1.06 kB
TypeScript
export interface SlotInfo {
srcLsn: string;
dstLsn: string;
gap: number;
gapTillLatch: number;
lagSec: number | null;
latched: {
srcLsn: string;
at: number;
};
}
/**
* Returns the difference between src LSN and dst LSN (gap), along with some
* estimation on how much seconds they are apart from each other. To measure
* that time, we "latch" an LSN on the src and then wait until dst crosses that
* latched LSN. Once it does, we remember the actual astronomical time it took
* to cross, and then latch the src LSN again (towards the next estimation
* cycle). When the caller decides that the time is small enough, it stops
* polling; and if the time is large (e.g. more than 20 seconds), it continues
* to call getSlotInfo() over and over again until that time drops below the
* needed 20 seconds threshold.
*/
export declare function getSlotInfo({ dsn, slotName, }: {
dsn: string;
slotName: string;
}, prevSlotInfo: SlotInfo | undefined): Promise<SlotInfo>;
//# sourceMappingURL=getSlotInfo.d.ts.map