-
-
Notifications
You must be signed in to change notification settings - Fork 622
fix: blob data corruption when adding columnar attribute to RT table #4179
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
Merged
Conversation
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
When adding a columnar attribute (e.g., MULTI64 ENGINE='columnar') to an RT table that already has STRING attributes (blobs), the blob pool file (.spb) was being truncated, causing "Blob offset out of bounds" errors during index checks and potential crashes during queries. Root cause: - CSphIndex_VLN::AddRemoveAttribute was creating a new .spb file when adding a columnar attribute, but Alter_AddRemoveRowwiseAttr (which writes blob data) was not called for columnar attributes - This resulted in the new file containing only the header and update space, overwriting the existing blob data Fix: - Preserve existing blob data by reading it from the old blob pool file before Reset() and writing it to the new temporary file - Also clean up the temporary .tmp.spa file that was left behind when adding columnar attributes to tables with non-columnar attributes Test: - Added test case in test_479/test.xml to verify blob data preservation after ALTER TABLE ADD COLUMN with columnar attribute Related issue #3661
4 tasks
glookka
approved these changes
Jan 25, 2026
Contributor
clt❌ CLT tests in Failed tests:🔧 Edit failed tests in UI: test/clt-tests/buddy-plugins/test-inconsistent-comunication-with-buddy.rec––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /dev/null; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /var/log/manticore/searchd.log;fi
––– output –––
OK
––– input –––
apt-get install jq -y > /dev/null; echo $?
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?mode=raw" -d "query=SHOW TABLES"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?mode=raw&query=SHOW%20TABLES"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?raw_response=true" -d "query=SHOW TABLES"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?raw_response=true&query=SHOW%20TABLES"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?mode=raw" -d "query=SHOW VARIABLES"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?mode=raw&query=SHOW%20VARIABLES"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?raw_response=true" -d "query=SHOW VARIABLES"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?raw_response=true&query=SHOW%20VARIABLES"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?mode=raw" -d "query=SHOW META"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?mode=raw&query=SHOW%20META"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?raw_response=true" -d "query=SHOW META"; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?raw_response=true&query=SHOW%20META"; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?mode=raw" -d "query=SHOW QUERIES" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?mode=raw&query=SHOW%20QUERIES" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?raw_response=true" -d "query=SHOW QUERIES" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
[
{
"total": %{NUMBER},
"error": "",
"warning": "",
"columns": [
{
"id": {
"type": "long long"
}
},
{
"query": {
"type": "string"
}
},
{
"time": {
"type": "string"
}
},
{
"protocol": {
"type": "string"
}
},
{
"host": {
"type": "string"
}
}
],
"data": [
{
"id": %{NUMBER},
"query": "#!/[a-zA-Z\s\_]+/!#",
"time": "%{NUMBER}#!/(s|ms|us)/!#",
"protocol": "http",
"host": "127.0.0.1:%{NUMBER}"
},
{
"id": %{NUMBER},
"query": "#!/[a-zA-Z\s\_]+/!#",
"time": "%{NUMBER}#!/(s|ms|us)/!# ago",
"protocol": "http",
"host": "127.0.0.1:%{NUMBER}"
},
{
"id": %{NUMBER},
"query": "#!/[a-zA-Z\s\_]+/!#",
"time": "%{NUMBER}#!/(s|ms|us)/!# ago",
"protocol": "http",
"host": "127.0.0.1:%{NUMBER}"
- }
+ },
- ]
+ {
- }
+ "id": 27,
- ]
+ "query": "",
+ "time": "2926w ago",
+ "protocol": "http",
+ "host": "127.0.0.1:45764"
+ }
+ ]
+ }
+ ]
––– input –––
curl -s "http://localhost:9308/sql?raw_response=true&query=SHOW%20QUERIES" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?mode=raw" -d "query=SHOW VERSION" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?mode=raw&query=SHOW%20VERSION" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s -X POST "http://localhost:9308/sql?raw_response=true" -d "query=SHOW VERSION" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK
––– input –––
curl -s "http://localhost:9308/sql?raw_response=true&query=SHOW%20VERSION" | jq '.[0].data |= sort_by(.id)'; echo
––– output –––
OK |
sanikolaev
added a commit
that referenced
this pull request
Jan 25, 2026
Related issue #3661 Related PR #4179 Co-authored-by: Ilya Kuznetsov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When adding a columnar attribute (e.g., MULTI64 ENGINE='columnar') to an RT table that already has STRING attributes (blobs), the blob pool file (.spb) was being truncated, causing "Blob offset out of bounds" errors during index checks and potential crashes during queries.
Root cause:
Fix:
Test:
Related issue #3661