Skip to content
Draft

Undo #21

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
073a88b
Rebase on upstream hourly, add AI/LLM PR review
gburd Mar 10, 2026
8399072
dev setup v27
gburd Mar 20, 2026
b154094
Add UNDO WAL logging infrastructure with physical rollback
gburd Mar 21, 2026
78a6080
[NOT FOR MERGE] Examples and design notes for UNDO subsystems
gburd Mar 25, 2026
16e4f36
Add transactional file operations (FILEOPS) framework
gburd Apr 17, 2026
d060adf
Add FILEOPS CREATE operation
gburd Apr 17, 2026
423846e
Add FILEOPS DELETE operation
gburd Apr 17, 2026
4cf17e9
Add FILEOPS RENAME operation
gburd Apr 17, 2026
060118b
Add FILEOPS WRITE operation
gburd Apr 17, 2026
e37ac19
Add FILEOPS TRUNCATE operation
gburd Apr 17, 2026
24009f8
Add FILEOPS CHMOD and CHOWN operations
gburd Apr 17, 2026
08b8609
Add FILEOPS MKDIR and RMDIR operations
gburd Apr 17, 2026
b404316
Add FILEOPS SYMLINK and LINK operations
gburd Apr 17, 2026
1e3c34a
Add FILEOPS SETXATTR and REMOVEXATTR operations
gburd Apr 17, 2026
058c2f4
[NOT FOR MERGE] Examples and tests for transactional file operations
gburd Apr 17, 2026
70406af
Add UNDO-informed index pruning infrastructure
gburd Apr 16, 2026
bc3d97c
[NOT FOR MERGE] Design notes for index pruning
gburd Apr 16, 2026
9a30fb3
Add UNDO-informed index pruning for NBTREE
gburd Apr 16, 2026
ffdbcf8
Add UNDO-informed index pruning for HASH
gburd Apr 16, 2026
f263187
Add UNDO-informed index pruning for GIN
gburd Apr 16, 2026
4fdbaab
Add UNDO-informed index pruning for GiST
gburd Apr 16, 2026
ccff31a
Add UNDO-informed index pruning for SP-GiST
gburd Apr 16, 2026
9af21f6
Add UNDO-informed index pruning VACUUM integration
gburd Apr 16, 2026
576b44a
Integrate cluster-wide UNDO with the Heap table AM
gburd Mar 21, 2026
2159098
Add nbtree UNDO for zero-VACUUM aborted transaction cleanup
gburd Apr 21, 2026
dd29aed
[NOT FOR MERGE] Design notes for cluster-wide UNDO with Heap table AM
gburd Apr 17, 2026
292172c
Add checkpoint phase timing instrumentation and UNDO checkpoint hook
gburd Apr 25, 2026
b81b169
[NOT FOR MERGE] Benchmarks examining UNDO overhead and benefits
gburd Apr 25, 2026
eccdfa8
Rewrite benchmarks for OLTP-style targeted operations; add portability
gburd Apr 25, 2026
e93430f
Optimize UNDO write path: defer fsync, cache fds, atomic alloc, reuse…
gburd Apr 26, 2026
bced95b
Add UNDO flush daemon with group commit
gburd Apr 27, 2026
9500b8d
Update flake.lock
gburd Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Diagnostics:
MissingIncludes: None
InlayHints:
Enabled: true
ParameterNames: true
DeducedTypes: true
CompileFlags:
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
Remove: [ -Werror ]
Add:
- -DDEBUG
- -DLOCAL
- -DPGDLLIMPORT=
- -DPIC
- -O2
- -Wall
- -Wcast-function-type
- -Wconversion
- -Wdeclaration-after-statement
- -Wendif-labels
- -Werror=vla
- -Wextra
- -Wfloat-equal
- -Wformat-security
- -Wimplicit-fallthrough=3
- -Wmissing-format-attribute
- -Wmissing-prototypes
- -Wno-format-truncation
- -Wno-sign-conversion
- -Wno-stringop-truncation
- -Wno-unused-const-variable
- -Wpointer-arith
- -Wshadow
- -Wshadow=compatible-local
- -fPIC
- -fexcess-precision=standard
- -fno-strict-aliasing
- -fvisibility=hidden
- -fwrapv
- -g
- -std=c11
- -I.
- -I../../../../src/include
# gcc -E -v -xc++ /dev/null
# - -I/nix/store/l2sgvfcyqc1bgnzpz86qw5pjq99j8vlw-libtool-2.5.4/include
# - -I/nix/store/n087ac9g368fbl6h57a2mdd741lshzrc-file-5.46-dev/include
# - -I/nix/store/p7z72c2s722pbw31jmm3y0nwypksb5fj-gnumake-4.4.1/include
# - -I/nix/store/wzwlizg15dwh6x0h3ckjmibdblfkfdzf-flex-2.6.4/include
# - -I/nix/store/8nh579b2yl3sz2yfwyjc9ksb0jb7kwf5-libxslt-1.1.43-dev/include
# - -I/nix/store/cisb0723v3pgp74f2lj07z5d6w3j77sl-libxml2-2.13.8-dev/include
# - -I/nix/store/245c5yscaxyxi49fz9ys1i1apy5s2igz-valgrind-3.24.0-dev/include
# - -I/nix/store/nmxr110602fvajr9ax8d65ac1g40vx1a-curl-8.13.0-dev/include
# - -I/nix/store/slqvy0fgnwmvaq3bxmrvqclph8x909i2-brotli-1.1.0-dev/include
# - -I/nix/store/lchvccw6zl1z1wmhqayixcjcqyhqvyj7-krb5-1.21.3-dev/include
# - -I/nix/store/hybw3vnacqmm68fskbcchrbmj0h4ffv2-nghttp2-1.65.0-dev/include
# - -I/nix/store/2m0s7qxq2kgclyh6cfbflpxm65aga2h4-libidn2-2.3.8-dev/include
# - -I/nix/store/kcgqglb4iax0zh5jlrxmjdik93wlgsrq-openssl-3.4.1-dev/include
# - -I/nix/store/8mlcjg5js2r0zrpdjlfaxax6hyvppgz5-libpsl-0.21.5-dev/include
# - -I/nix/store/1nygjgimkj4wnmydzd6brsw6m0rd7gmx-libssh2-1.11.1-dev/include
# - -I/nix/store/cbdvjyn19y77m8l06n089x30v7irqz3j-zlib-1.3.1-dev/include
# - -I/nix/store/x10zhllc0rhk1s1mhjvsrzvbg55802gj-zstd-1.5.7-dev/include
# - -I/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/include
# - -I/nix/store/1lrgn56jw2yww4bxj0frpgvahqh9i7gl-perf-linux-6.12.35/include
# - -I/nix/store/j87n5xqfj6c03633g7l95lfjq5ynml13-gdb-16.2/include
# - -I/nix/store/ih8dkkw9r7zx5fxg3arh53qc9zs422d1-llvm-21.1.0-dev/include
# - -I/nix/store/rz4bmcm8dwsy7ylx6rhffkwkqn6n8srn-ncurses-6.5-dev/include
# - -I/nix/store/29mcvdnd9s6sp46cjmqm0pfg4xs56rik-zlib-1.3.1-dev/include
# - -I/nix/store/42288hw25sc2gchgc5jp4wfgwisa0nxm-lldb-21.1.0-dev/include
# - -I/nix/store/wpfdp7vzd7h7ahnmp4rvxfcklg4viknl-tcl-8.6.15/include
# - -I/nix/store/4sq2x2770k0xrjshdi6piqrazqjfi5s4-readline-8.2p13-dev/include
# - -I/nix/store/myw381bc9yqd709hpray9lp7l98qmlm1-ncurses-6.5-dev/include
# - -I/nix/store/dvhx24q4icrig4q1v1lp7kzi3izd5jmb-icu4c-76.1-dev/include
# - -I/nix/store/7ld4hdn561a4vkk5hrkdhq8r6rxw8shl-lz4-1.10.0-dev/include
# - -I/nix/store/fnzbi6b8q79faggzj53paqi7igr091w0-util-linux-minimal-2.41-dev/include
# - -I/nix/store/vrdwlbzr74ibnzcli2yl1nxg9jqmr237-linux-pam-1.6.1/include
# - -I/nix/store/qizipyz9y17nr4w4gmxvwd3x4k0bp2rh-libxcrypt-4.4.38/include
# - -I/nix/store/7z8illxfqr4mvwh4l3inik6vdh12jx09-numactl-2.0.18-dev/include
# - -I/nix/store/f6lmz5inbk7qjc79099q4jvgzih7zbhy-openldap-2.6.9-dev/include
# - -I/nix/store/28vmjd90wzd6gij5a1nfj4nqaw191cfg-liburing-2.9-dev/include
# - -I/nix/store/75cyhmjxzx8z7v2z8vrmrydwraf00wyi-libselinux-3.8.1-dev/include
# - -I/nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include
# - -I/nix/store/ldp1izmflvc74bd4n2svhrd5xrz61wyi-lld-21.1.0-dev/include
# - -I/nix/store/wd5cm50kmlw8n9mq6l1mkvpp8g443a1g-compiler-rt-libc-21.1.0-dev/include
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/include/c++/14.2.1.20250322/
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/include/c++/14.2.1.20250322//x86_64-unknown-linux-gnu
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/include/c++/14.2.1.20250322//backward
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/lib/gcc/x86_64-unknown-linux-gnu/14.2.1/include
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/include
# - -I/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/lib/gcc/x86_64-unknown-linux-gnu/14.2.1/include-fixed
35 changes: 35 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set tui tab-width 4
set tui mouse-events off

#b ExecOpenIndicies
b ExecInsertIndexTuples
b heapam_tuple_update
b simple_heap_update
b heap_update
b ExecUpdateModIdxAttrs
b HeapUpdateModIdxAttrs
b ExecCompareSlotAttrs
b HeapUpdateHotAllowable
b HeapUpdateDetermineLockmode
b heap_page_prune_opt
b ExecInjectSubattrContext
b ExecBuildUpdateProjection

b InitMixTracking
b RelationGetIdxSubpaths

b jsonb_idx_extract
b jsonb_idx_compare
b jsonb_set
b jsonb_delete_path
b jsonb_insert
b extract_jsonb_path_from_expr

b RelationGetIdxSubattrs
b attr_has_subattr_indexes

#b fork_process
#b ParallelWorkerMain
#set follow-fork-mode child
#b initdb.c:3105

18 changes: 18 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Node modules
scripts/ai-review/node_modules/
# Note: package-lock.json should be committed for reproducible CI/CD builds

# Logs
scripts/ai-review/cost-log-*.json
scripts/ai-review/*.log

# OS files
.DS_Store
Thumbs.db

# Editor files
*.swp
*.swo
*~
.vscode/
.idea/
163 changes: 163 additions & 0 deletions .github/DEV_SETUP_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Dev Setup Commit Fix - Summary

**Date:** 2026-03-10
**Issue:** Sync workflow was failing because "dev setup" commits were detected as pristine master violations

## Problem

The sync workflow was rejecting the "dev setup v19" commit (e5aa2da496c) because it modifies files outside `.github/`. The original logic only allowed `.github/`-only commits, but didn't account for personal development environment commits.

## Solution

Updated sync workflows to recognize commits with messages starting with "dev setup" (case-insensitive) as allowed on master, in addition to `.github/`-only commits.

## Changes Made

### 1. Updated Sync Workflows

**Files modified:**
- `.github/workflows/sync-upstream.yml` (automatic hourly sync)
- `.github/workflows/sync-upstream-manual.yml` (manual sync)

**New logic:**
```bash
# Check for "dev setup" commits
DEV_SETUP_COMMITS=$(git log --format=%s upstream/master..origin/master | grep -i "^dev setup" | wc -l)

# Allow merge if:
# - Only .github/ changes, OR
# - Has "dev setup" commits
if [ "$COMMITS_AHEAD" -gt 0 ] && [ "$NON_GITHUB_CHANGES" -gt 0 ]; then
if [ "$DEV_SETUP_COMMITS" -eq 0 ]; then
# FAIL: Code changes outside .github/ that aren't dev setup
exit 1
else
# OK: Dev setup commits are allowed
continue merge
fi
fi
```

### 2. Created Policy Documentation

**New file:** `.github/docs/pristine-master-policy.md`

Documents the "mostly pristine" master policy:
- ✅ `.github/` commits allowed (CI/CD configuration)
- ✅ "dev setup ..." commits allowed (personal development environment)
- ❌ Code changes not allowed (must use feature branches)

## Current Commit Order

```
master:
1. 9a2b895daa0 - Complete Phase 3: Windows builds + fix sync (newest)
2. 1e6379300f8 - Add CI/CD automation: hourly sync, Bedrock AI review
3. e5aa2da496c - dev setup v19
4. 03facc1211b - upstream commits... (oldest)
```

**All three local commits will now be preserved during sync:**
- Commit 1: Modifies `.github/` ✅
- Commit 2: Modifies `.github/` ✅
- Commit 3: Named "dev setup v19" ✅

## Testing

After committing these changes, the next hourly sync should:
1. Detect 3 commits ahead of upstream (including the fix commit)
2. Recognize that they're all allowed (`.github/` or "dev setup")
3. Successfully merge upstream changes
4. Create merge commit preserving all local commits

**Verify manually:**
```bash
# Trigger manual sync
# Actions → "Sync from Upstream (Manual)" → Run workflow

# Check logs for:
# "✓ Found 1 'dev setup' commit(s) - will merge"
# "✓ Successfully merged upstream with local configuration"
```

## Future Updates

When updating your development environment:

```bash
# Make changes
git add .clangd flake.nix .vscode/ .idea/

# IMPORTANT: Start commit message with "dev setup"
git commit -m "dev setup v20: Update IDE and LSP configuration"

git push origin master
```

The sync will recognize this and preserve it during merges.

**Naming patterns recognized:**
- `dev setup v20` ✅
- `Dev setup: Update tools` ✅
- `DEV SETUP - New config` ✅
- `development environment changes` ❌ (doesn't start with "dev setup")

## Benefits

1. **No manual sync resolution needed** for dev environment updates
2. **Simpler workflow** - dev setup stays on master where it's convenient
3. **Clear policy** - documented what's allowed vs what requires feature branches
4. **Automatic detection** - sync workflow handles it all automatically

## What to Commit

```bash
git add .github/workflows/sync-upstream.yml
git add .github/workflows/sync-upstream-manual.yml
git add .github/docs/pristine-master-policy.md
git add .github/DEV_SETUP_FIX.md

git commit -m "Fix sync to allow 'dev setup' commits on master

The sync workflow was failing because the 'dev setup v19' commit
modifies files outside .github/. Updated workflows to recognize
commits with messages starting with 'dev setup' as allowed on master.

Changes:
- Detect 'dev setup' commits by message pattern
- Allow merge if commits are .github/ OR dev setup
- Update merge messages to reflect preserved changes
- Document pristine master policy

This allows personal development environment commits (IDE configs,
debugging tools, shell aliases, etc.) on master without violating
the pristine mirror policy.

See .github/docs/pristine-master-policy.md for details"

git push origin master
```

## Next Sync Expected Behavior

```
Before:
Upstream: A---B---C---D (latest upstream)
Master: A---B---C---X---Y---Z (X=CI/CD, Y=CI/CD, Z=dev setup)

Status: 3 commits ahead, 1 commit behind

After:
Master: A---B---C---X---Y---Z---M
\ /
D-------/

Where M = Merge commit preserving all local changes
```

All three local commits (CI/CD + dev setup) preserved! ✅

---

**Status:** Ready to commit and test
**Documentation:** See `.github/docs/pristine-master-policy.md`
Loading
Loading