Comments (15)
@RaduBerinde We're still observing empty copy spans on 24.1. Is this a new bug?
from cockroach.
Yeah, all known bugs have been fixed, so we must have missed something.. We are sure that the test never causes external ingestions where there are no keys in the span?
from cockroach.
@msbutler I have found that the test attempts an empty ingestion. I ran under stress against cockroachdb/pebble#3506 and I got:
* panic: external ingestion is empty: data/959416941262372865.sst ("\xf6w\x8a\x00" "\xf6w\x8b\x00" inclusive=false)
This means that there are no keys in that sst within the bound.
from cockroach.
Here is an LSM that triggers the error. Tables 40 and 7 have no keys inside.
from cockroach.
aha! thanks for digging into this. I'll look into why this could happen.
from cockroach.
I stressed this test on top of a patch that panics in backup if it creates a backup file without any point keys, and no panic occurred during the repro, suggesting the source of the empty download span is not due to backup.
from cockroach.
The physical file can have keys, the question is whether the portion that is being ingested (StartKey
to EndKey
) has any keys.
from cockroach.
Ah, to clarify: in DR land, a physical backup sst is partitioned into several backup files
(i.e. roughly the export request responses). In Online restore, we create virtual sst's for each backup file. The terminology is really confusing and we should probably come up with a new term for backup file.
My patch above was verifying that no backup file was empty during the test failure.
from cockroach.
The panic above shows that there is an external ingestion with no keys between the bounds. OR is the only one that does external ingestions. Maybe the bounds get screwed up somehow?
from cockroach.
I can extend the patch to show all the keys in the physical file, that should give us some clue.
from cockroach.
Ah, that LSM visualizer is really helpful. I think understand how this could happen. Suppose table 120 has a secondary index, restore will partition the table's key space into two units of work (a restoreSpanEntry
): [Table/120/1-Table/120/2)
,[Table/120/2-Table/120/3)
, but what if that second index is empty?
On the backup side, we very well could create a non empty backup file that spans the two indexes: [Table/120/1-Table/120/3)
-- we construct backup units of work on the table level-- but restore we create units of work on the table-index level and will break up the table wide span for virtual sst ingestion here. Given all of this, we'll create a virtual sst that has no keys: [Table/120/2-Table/120/3)
.
To reproduce, I'll try to backup and online restore a table with an empty secondary index.
from cockroach.
here's the schema of the backed up table during a failing test case. i wonder if we can induce this via a partial index:
I240412 14:25:02.267796 906 5@util/log/event_log.go:32 â<8b>® [T1,Vsystem,n1,client=127.0.0.1:41058,hostssl,user=root] 127 ={"Timestamp":1712931902263077505,"EventType":"create_table","Statement":"CREATE TABLE â<80>¹randâ<80>º.public.â<80>¹t able_1â<80>º (â<80>¹col1_0â<80>º BOX2D NULL, â<80>¹\"col1|_1\"â<80>º BOOL NOT NULL, â<80>¹col1_2â<80>º REGCLASS NULL, â<80>¹col1_3â<80>º JSONB NOT NULL, â<80>¹col1_4â<80>º VARCHAR NOT NULL, PRIMARY KEY (â<80>¹col1_4â<80>º, â<80>¹\"col1|_1\"â <80>º ASC), INDEX (â<80>¹col1_0â<80>º ASC), INDEX (â<80>¹crdb_internal_idx_exprâ<80>º DESC), INDEX (â<80>¹col1_3â<80>º DESC) STORING (â<80>¹col1_0â<80>º), UNIQUE (â<80>¹\"col1|_1\"â<80>º, â<80>¹col1_4â<80>º DESC) STORING (â<80>¹col1_0â<80>º, â<80>¹col1_3â<80>º) WHERE â<80>¹table_1â<80>º.â<80>¹\"col1|_1\"â<80>º, INDEX (â<80>¹\"col1|_1\"â<80>º) WHERE â<80>¹table_1â<80>º.â<80>¹col1_4â<80>º >= â<80>¹'\"'â<80>º:::STRING)","Tag":"CREATE TABLE","User":"root","DescriptorID":106,"TableN ame":"â<80>¹rand.public.table_1â<80>º"}
from cockroach.
Alrighty, I think my above theory holds: if I patch restore to create units of work on the table level, I cannot reproduce the empty download span bug. Even better, if i patch backup to create work on the table-index level, I cannot hit the bug either.
I still haven't figured out how to easily repro this bug. For example, I cant get this unit test to fail under stess, even though it contains an empty index. Some how in mvcc export request, we generally avoid returning an export response that spans the empty index span.
I also am unsure how we should fix this. Some candidates:
- change backup work units to the table-index level. we currently merge index spans as a perf hack, but backup is O(rows) not O(# indexes), as I've done with my backup patch linked above.
- relax the pebble invariant that we can't download empty file spans
- I don't think we can change restore's unit of work to the table level, as i think that violates some of our logic around introduced and dropped index spans blah blah blah.
from cockroach.
pkg/ccl/backupccl/backuprand/backuprand_test.TestBackupRestoreRandomDataRoundtrips failed on release-24.1 @ 53fcac10e573f8b3f0f6729fb7840f5ffba400b3:
=== RUN TestBackupRestoreRandomDataRoundtrips
test_log_scope.go:170: test logs captured to: outputs.zip/logTestBackupRestoreRandomDataRoundtrips2167932939
test_log_scope.go:81: use -show-logs to present logs inline
jobs_verification.go:98: job failed: failed to generate and send download spans: failed to download spans on 1 nodes; n1 returned error requesting download spans from node 1 (NODE_STATUS_LIVE): rpc error: code = Unknown desc = CopySpan cannot copy empty span \x91\x00#10035,DELSIZED \x92\x00#72057594037927935,RANGEDEL
panic.go:626: -- test log scope end --
test logs left over in: outputs.zip/logTestBackupRestoreRandomDataRoundtrips2167932939
--- FAIL: TestBackupRestoreRandomDataRoundtrips (29.79s)
Parameters:
attempt=1
run=3
shard=1
Same failure on other branches
- #122341 pkg/ccl/backupccl/backuprand/backuprand_test: TestBackupRestoreRandomDataRoundtrips failed [C-test-failure O-robot P-0 T-disaster-recovery branch-master release-blocker]
This test on roachdash | Improve this report!
from cockroach.
closed via #122679
from cockroach.
Related Issues (20)
- acceptance: TestCompose failed [KeyError: 'ContainerConfig'] HOT 2
- : failed HOT 1
- roachtest: vm_preemption failed HOT 78
- pkg/sql/logictest/tests/5node/5node_test: TestLogic_distsql_stats failed HOT 1
- ccl/backupccl: TestDataDriven_user_defined_functions failed HOT 1
- roachtest: activerecord failed HOT 6
- pkg/sql/logictest/tests/5node/5node_test: TestLogic_distsql_stats failed HOT 1
- ccl/backupccl: TestDataDriven_procedures failed HOT 1
- roachtest: c2c/tpcc/warehouses=1000/duration=60/cutover=30 failed [mysterious workload flake] HOT 1
- roachtest: ssh_problem failed HOT 4
- roachtest: failover/chaos/read-only/lease=expiration failed HOT 1
- kv/kvserver/liveness: TestNodeLivenessAppearsAtStart failed HOT 3
- `to_regrole` produces 0 unexpectedly HOT 2
- pkg/sql/opt/exec/execbuilder/tests/5node/5node_test: TestExecBuild_distsql_misc failed HOT 3
- roachtest: unoptimized-query-oracle/disable-rules=all/rand-tables failed HOT 1
- streamingccl: reduce replication lag from bulk ops from O(bulkOpRuntime*numNodes) to O(2*bulkOpRuntime) via replanning HOT 2
- roachtest: follower-reads/mixed-version/survival=region/locality=global/reads=strong failed HOT 1
- pkg/ccl/serverccl/statusccl/statusccl_test: TestTenantCannotSeeNonTenantStats failed HOT 1
- pkg/sql/logictest/tests/cockroach-go-testserver-23.2/cockroach-go-testserver-23_2_test: TestLogic_mixed_version_sequence_per_node_cache failed HOT 1
- cli: Zip tests failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cockroach.