-
Notifications
You must be signed in to change notification settings - Fork 212
Support separation of catalog and compute #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f6c2ecf
Support separation of catalog and compute.
ce02c5d
Merge branch 'cloudberrydb:main' into main
HuSen8891 4dbcda7
1. add global variable enable_serverless, default to false, set to tr…
e3ddd0f
rename json_object to pg_json_object to resolve conflict with library…
60e9089
disable WAL-log information required only for Hot Standby in serverless
adc9b32
Add support for creating cluster with single master, and only query o…
HuSen8891 85ba413
Add: Support to create hashdata table with randomly distribution.
HuSen8891 b5f5525
1. set distributedXid to LocalTransactionId 2. do not send FTS Probe …
HuSen8891 d3fa198
Feature: support subtransaction and savepoint
HuSen8891 8e698c1
Fix: Only master can set transaction status
HuSen8891 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,16 +133,16 @@ typedef enum | |
| static SlruErrorCause slru_errcause; | ||
| static int slru_errno; | ||
|
|
||
| /* | ||
| * Hooks for plugins to get control in SlruPhysicalReadPage/SlruPhysicalWritePage/SimpleLruReadPage | ||
| */ | ||
| SlruPhysicalReadPage_hook_type SlruPhysicalReadPage_hook = NULL; | ||
| SlruPhysicalWritePage_hook_type SlruPhysicalWritePage_hook = NULL; | ||
| SimpleLruReadPage_hook_type SimpleLruReadPage_hook = NULL; | ||
|
|
||
| static void SimpleLruZeroLSNs(SlruCtl ctl, int slotno); | ||
| static void SimpleLruWaitIO(SlruCtl ctl, int slotno); | ||
| static void SlruInternalWritePage(SlruCtl ctl, int slotno, SlruWriteAll fdata); | ||
| static bool SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno); | ||
| static bool SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, | ||
| SlruWriteAll fdata); | ||
| static void SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid); | ||
| static int SlruSelectLRUPage(SlruCtl ctl, int pageno); | ||
|
|
||
| static bool SlruScanDirCbDeleteCutoff(SlruCtl ctl, char *filename, | ||
| int segpage, void *data); | ||
| static void SlruInternalDeleteSegment(SlruCtl ctl, int segno); | ||
|
|
@@ -319,7 +319,7 @@ SimpleLruZeroPage(SlruCtl ctl, int pageno) | |
| * | ||
| * This assumes that InvalidXLogRecPtr is bitwise-all-0. | ||
| */ | ||
| static void | ||
| void | ||
| SimpleLruZeroLSNs(SlruCtl ctl, int slotno) | ||
| { | ||
| SlruShared shared = ctl->shared; | ||
|
|
@@ -336,7 +336,7 @@ SimpleLruZeroLSNs(SlruCtl ctl, int slotno) | |
| * | ||
| * Control lock must be held at entry, and will be held at exit. | ||
| */ | ||
| static void | ||
| void | ||
| SimpleLruWaitIO(SlruCtl ctl, int slotno) | ||
| { | ||
| SlruShared shared = ctl->shared; | ||
|
|
@@ -396,6 +396,9 @@ SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok, | |
| { | ||
| SlruShared shared = ctl->shared; | ||
|
|
||
| if (SimpleLruReadPage_hook) | ||
| return (*SimpleLruReadPage_hook) (ctl, pageno, write_ok, xid); | ||
|
|
||
| /* Outer loop handles restart if we must wait for someone else's I/O */ | ||
| for (;;) | ||
| { | ||
|
|
@@ -496,6 +499,12 @@ SimpleLruReadPage_ReadOnly(SlruCtl ctl, int pageno, TransactionId xid) | |
| SlruShared shared = ctl->shared; | ||
| int slotno; | ||
|
|
||
| if (SimpleLruReadPage_hook) | ||
| { | ||
| LWLockAcquire(shared->ControlLock, LW_EXCLUSIVE); | ||
| return (*SimpleLruReadPage_hook) (ctl, pageno, true, xid); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where release lock ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lock released by the caller. |
||
| } | ||
|
|
||
| /* Try to find the page while holding only shared lock */ | ||
| LWLockAcquire(shared->ControlLock, LW_SHARED); | ||
|
|
||
|
|
@@ -679,7 +688,7 @@ SimpleLruDoesPhysicalPageExist(SlruCtl ctl, int pageno) | |
| * For now, assume it's not worth keeping a file pointer open across | ||
| * read/write operations. We could cache one virtual file pointer ... | ||
| */ | ||
| static bool | ||
| bool | ||
| SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno) | ||
| { | ||
| SlruShared shared = ctl->shared; | ||
|
|
@@ -688,6 +697,13 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno) | |
| off_t offset = rpageno * BLCKSZ; | ||
| char path[MAXPGPATH]; | ||
| int fd; | ||
| bool result; | ||
|
|
||
| if (SlruPhysicalReadPage_hook && | ||
| SlruPhysicalReadPage_hook(ctl, pageno, slotno, &result)) | ||
| { | ||
| return result; | ||
| } | ||
|
|
||
| SlruFileName(ctl, path, segno); | ||
|
|
||
|
|
@@ -760,6 +776,7 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruWriteAll fdata) | |
| off_t offset = rpageno * BLCKSZ; | ||
| char path[MAXPGPATH]; | ||
| int fd = -1; | ||
| bool result; | ||
|
|
||
| /* update the stats counter of written pages */ | ||
| pgstat_count_slru_page_written(shared->slru_stats_idx); | ||
|
|
@@ -806,6 +823,12 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruWriteAll fdata) | |
| } | ||
| } | ||
|
|
||
| if (SlruPhysicalWritePage_hook && | ||
| SlruPhysicalWritePage_hook(ctl, pageno, slotno, &result)) | ||
| { | ||
| return result; | ||
| } | ||
|
|
||
| /* | ||
| * During a WriteAll, we may already have the desired file open. | ||
| */ | ||
|
|
@@ -926,7 +949,7 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruWriteAll fdata) | |
| * Issue the error message after failure of SlruPhysicalReadPage or | ||
| * SlruPhysicalWritePage. Call this after cleaning up shared-memory state. | ||
| */ | ||
| static void | ||
| void | ||
| SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid) | ||
| { | ||
| int segno = pageno / SLRU_PAGES_PER_SEGMENT; | ||
|
|
@@ -1011,7 +1034,7 @@ SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid) | |
| * | ||
| * Control lock must be held at entry, and will be held at exit. | ||
| */ | ||
| static int | ||
| int | ||
| SlruSelectLRUPage(SlruCtl ctl, int pageno) | ||
| { | ||
| SlruShared shared = ctl->shared; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.