Skip to content

Commit 39c8776

Browse files
authored
Merge branch 'master' into asv_s3_more
2 parents 12d850f + 3521df0 commit 39c8776

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+713
-388
lines changed

.github/PULL_REQUEST_TEMPLATE.md

-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33

44
#### What does this implement or fix?
55

6-
## Change Type (Required)
7-
- [ ] **Patch** (Bug fix or non-breaking improvement)
8-
- [ ] **Minor** (New feature, but backward compatible)
9-
- [ ] **Major** (Breaking changes)
10-
- [ ] **Cherry pick**
11-
126
#### Any other comments?
137

148
#### Checklist

.github/workflows/analysis_workflow.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ on:
1010
type: string
1111
default: latest
1212
suite_to_run:
13-
description: Run LMDB suite or REAL storage
13+
description: Run LMDB suite or REAL storage (or both - ALL)
1414
type: choice
1515
options:
1616
- 'LMDB'
1717
- 'REAL'
18+
- 'ALL'
1819
default: 'LMDB'
1920
suite_overwrite:
2021
description: Specify regular expression for specific tests to be executed
@@ -63,7 +64,7 @@ jobs:
6364
run_all_benchmarks: ${{ inputs.run_all_benchmarks || false }}
6465
run_on_pr_head: ${{ github.event_name == 'pull_request_target' }}
6566
dev_image_tag: ${{ inputs.dev_image_tag || 'latest' }}
66-
suite_to_run: ${{ inputs.suite_to_run || 'LMDB'}}
67+
suite_to_run: ${{ github.event_name == 'schedule' && 'ALL' || inputs.suite_to_run || 'LMDB'}}
6768
suite_overwrite: ${{ inputs.suite_overwrite || ''}}
6869

6970
publish_benchmark_results_to_gh_pages:
@@ -87,7 +88,7 @@ jobs:
8788
run: |
8889
apt update
8990
apt install -y git
90-
python -m pip install arcticdb[Testing] "protobuf<5"
91+
python -m pip install arcticdb[Testing] "protobuf<6"
9192
9293
- name: Setup softlink for SSL
9394
shell: bash -el {0}

.github/workflows/automated_release.calculate_next_version.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
id: get_increment_type
4949
env:
5050
PULL_REQUESTS: ${{ steps.pull_requests.outputs.pull_requests }}
51-
MAJOR_LABEL: major
52-
MINOR_LABEL: minor
53-
PATCH_LABEL: patch
51+
MAJOR_LABEL: "api break"
52+
MINOR_LABEL: "enhancement"
53+
PATCH_LABEL: "bug"
5454
run: |
5555
if [ -z "$PULL_REQUESTS" ]; then
5656
echo "Error: No PRs found between branches" && exit 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Pull Request Labels
2+
on:
3+
pull_request:
4+
types: [opened, labeled, unlabeled, synchronize]
5+
branches: master
6+
jobs:
7+
check_labels:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
steps:
13+
- uses: mheap/github-action-required-labels@v5
14+
with:
15+
mode: exactly
16+
count: 1
17+
labels: |
18+
patch
19+
minor
20+
major
21+
add_comment: true

.github/workflows/automated_release.create_release_branch.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ jobs:
3333
create-next-release-branch:
3434
needs: [calculate-next-version, get-master-sha]
3535
runs-on: ubuntu-latest
36+
environment: TestPypi # For the branch restrictions token
37+
permissions:
38+
contents: write
3639
outputs:
3740
new_branch: ${{ needs.calculate-next-version.outputs.version }}
3841
steps:
3942
- name: Create branch ${{ needs.calculate-next-version.outputs.version }} from ${{ needs.get-master-sha.outputs.sha }}
4043
uses: peterjgrainger/[email protected]
4144
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
GITHUB_TOKEN: ${{ secrets.TAGGING_TOKEN }}
4346
with:
4447
branch: ${{ needs.calculate-next-version.outputs.version }}
4548
sha: ${{ needs.get-master-sha.outputs.sha }}

.github/workflows/automated_release.parse_pr_template.yml

-81
This file was deleted.

.github/workflows/benchmark_commits.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
commit: {required: true, type: string, description: commit hash that will be benchmarked}
77
run_on_pr_head: {required: false, default: false, type: boolean, description: Specifies if the benchmark should run on PR head branch}
88
dev_image_tag: {required: false, default: 'latest', type: string, description: Tag of the ArcticDB development image}
9-
suite_to_run: {required: true, type: string, default: 'LMDB', description: Default benchmark on 'LMDB' storage (or 'REAL' storage)}
9+
suite_to_run: {required: true, type: string, default: 'LMDB', description: Default benchmark on 'LMDB' storage (or 'REAL' storage ond 'ALL' for both)}
1010
suite_overwrite: {required: false, type: string, default: '', description: User defined tests to run}
1111
jobs:
1212
start_ec2_runner:
@@ -74,12 +74,17 @@ jobs:
7474
pip install asv virtualenv
7575
python -m asv machine -v --yes --machine ArcticDB-Medium-Runner
7676
77-
- name: Confugure what suite or tests to execute
77+
- name: Configure what suite or tests to execute
7878
shell: bash -el {0}
7979
run: |
80-
if [ "${{ github.event.inputs.suite_to_run }}" == "REAL" ]; then
80+
if [ "${{ inputs.suite_to_run }}" == "REAL" ]; then
81+
# ASV tests with real storage starts with 'real_' in the test name
8182
SUITE='^(real_).*'
83+
elif [ "${{ inputs.suite_to_run }}" == "ALL" ]; then
84+
# Select all tests
85+
SUITE='^.*'
8286
else
87+
# LMDB tests are other tests not starting with 'real_'
8388
SUITE='^(?!real_).*'
8489
fi
8590
echo "selection of suite SUITE=$SUITE"
@@ -110,7 +115,7 @@ jobs:
110115
- name: Add results to ArcticDB database
111116
shell: bash -el {0}
112117
run: |
113-
pip install arcticdb[Testing]
118+
pip install arcticdb[Testing] "protobuf<6"
114119
python build_tooling/transform_asv_results.py --mode save ${{ github.ref != 'refs/heads/master' && format('--arcticdb_library {0}_asv_results', github.ref_name) || ''}}
115120
116121
stop-ec2-runner:

.github/workflows/docs_build.yml

+3-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
version: { type: string, required: false, description: "The version to build (used in git and pypi). git-tag='v{version}-docs'. If not specified then use selected branch and wheel from the last successful build."}
66
latest: { type: boolean, required: false, description: Alias this version as the 'latest' stable docs. This should be set for the latest stable release.}
77
deploy: { type: boolean, required: false, description: Push the built docs to the docs-pages branch on github.}
8-
8+
99
jobs:
1010
docs_build:
1111
runs-on: ubuntu-22.04
@@ -34,7 +34,7 @@ jobs:
3434
prefix = {"CPython": "cp", "PyPy": "pp"}[platform.python_implementation()]
3535
v = platform.python_version_tuple()
3636
print(f"PY_IMPL={prefix}{v[0]}{v[1]}")' | tee -a $GITHUB_ENV
37-
37+
3838
- id: download-wheel-artifact
3939
name: Download wheel artifact from last successful build
4040
if: ${{!inputs.version}}
@@ -75,7 +75,7 @@ jobs:
7575
cd docs/mkdocs
7676
mike list
7777
78-
- name: Versioned mkDocs build
78+
- name: Versioned mkDocs build
7979
run: |
8080
set -x
8181
cd docs/mkdocs
@@ -91,16 +91,3 @@ jobs:
9191
set -x
9292
cd docs/mkdocs
9393
mike list
94-
95-
- name: Checkout docs-pages branch
96-
run: git checkout docs-pages
97-
98-
- name: Deploy Docs to TestPypi
99-
uses: cloudflare/[email protected]
100-
with:
101-
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
102-
accountId: ${{vars.CLOUDFLARE_ACCOUNT_ID}}
103-
projectName: ${{vars.CLOUDFLARE_PAGES_PROJECT}}
104-
directory: .
105-
branch: test
106-

.github/workflows/docs_publish.yml

-24
This file was deleted.

.github/workflows/failure_notification.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
status: ${{ github.event.workflow_run.conclusion }}
1616
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
17-
message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
17+
message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|${{github.repository}}>"
1818
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
1919
env:
2020
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- id: changelog
5050
name: Release Changelog Builder
51-
uses: mikepenz/release-changelog-builder-action@v3.7.3
51+
uses: mikepenz/release-changelog-builder-action@v5
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
with:

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ docs/mkdocs/docs/notebooks/.ipynb_checkpoints/
5050
# Ignore asv results
5151
python/.asv/html/
5252
python/.asv/results/
53+
54+
# Ignore azurite files
55+
__azurite_*

build_tooling/change_log.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"categories": [
3+
{
4+
"title": "## ⚠️ Breaking Changes",
5+
"labels": ["api break", "major"]
6+
},
37
{
48
"title": "## 🚀 Features",
5-
"labels": ["enhancement"]
9+
"labels": ["enhancement", "minor"]
610
},
711
{
812
"title": "## 🐛 Fixes",
9-
"labels": ["bug"]
13+
"labels": ["bug", "patch"]
1014
}
1115
],
1216
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",

cpp/arcticdb/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ if(${TEST})
937937
processing/test/test_component_manager.cpp
938938
processing/test/test_expression.cpp
939939
processing/test/test_filter_and_project_sparse.cpp
940-
processing/test/test_has_valid_type_promotion.cpp
940+
processing/test/test_type_promotion.cpp
941941
processing/test/test_operation_dispatch.cpp
942942
processing/test/test_parallel_processing.cpp
943943
processing/test/test_resample.cpp

cpp/arcticdb/codec/segment.cpp

+35-7
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ struct DeserializedSegmentData {
139139
};
140140

141141
DeserializedSegmentData decode_header_and_fields(const uint8_t*& src, bool copy_data) {
142+
util::check(src != nullptr, "Got null data ptr from segment");
142143
auto* fixed_hdr = reinterpret_cast<const FixedHeader*>(src);
143144
ARCTICDB_DEBUG(log::codec(), "Reading header: {} + {} = {}", FIXED_HEADER_SIZE, fixed_hdr->header_bytes, FIXED_HEADER_SIZE + fixed_hdr->header_bytes);
144145

@@ -279,14 +280,41 @@ std::pair<uint8_t*, size_t> Segment::serialize_v1_header_in_place(size_t total_h
279280

280281
std::tuple<uint8_t*, size_t, std::unique_ptr<Buffer>> Segment::serialize_v1_header_to_buffer(size_t hdr_size) {
281282
auto tmp = std::make_unique<Buffer>();
282-
ARCTICDB_TRACE(log::storage(), "Header doesn't fit in internal buffer, needed {} bytes but had {}, writing to temp buffer at {:x}", hdr_size, buffer_.preamble_bytes(),uintptr_t(tmp->data()));
283-
tmp->ensure(calculate_size());
283+
auto bytes_to_copy = buffer().bytes();
284+
auto offset = FIXED_HEADER_SIZE + hdr_size;
285+
286+
auto total_size = offset + bytes_to_copy;
287+
288+
// Verify we have enough space for everything
289+
tmp->ensure(total_size);
290+
util::check(tmp->available() >= total_size,
291+
"Buffer available space {} is less than required size {}",
292+
tmp->available(),
293+
total_size);
294+
295+
// This is both a sanity check and a way to populate the segment with the correct size
296+
auto calculated_size = calculate_size();
297+
util::check(total_size == calculated_size, "Expected total size {} to be equal to calculated size {}", total_size, calculated_size);
298+
284299
auto* dst = tmp->preamble();
285-
write_proto_header(dst);
286-
std::memcpy(dst + FIXED_HEADER_SIZE + hdr_size,
287-
buffer().data(),
288-
buffer().bytes());
289-
return std::make_tuple(tmp->preamble(), calculate_size(), std::move(tmp));
300+
util::check(dst != nullptr, "Expected dst to be non-null");
301+
302+
auto written_hdr_size = write_proto_header(dst);
303+
util::check(written_hdr_size == hdr_size, "Expected written header size {} to be equal to expected header size {}", written_hdr_size, hdr_size);
304+
305+
auto *final_dst = dst + offset;
306+
307+
auto *src = buffer().data();
308+
if (src != nullptr) {
309+
std::memcpy(final_dst,
310+
src,
311+
bytes_to_copy);
312+
} else {
313+
util::check(bytes_to_copy == 0, "Expected bytes_to_copy to be 0 when src is nullptr");
314+
ARCTICDB_DEBUG(log::codec(), "src is nullptr, skipping memcpy");
315+
}
316+
317+
return std::make_tuple(dst, total_size, std::move(tmp));
290318
}
291319

292320
std::tuple<uint8_t*, size_t, std::unique_ptr<Buffer>> Segment::serialize_header_v1() {

0 commit comments

Comments
 (0)