vrtmrz / obsidian-livesync

MIT License
3.93k stars 132 forks source link

Conflicts causing high cpu use #380

Open gerroon opened 4 months ago

gerroon commented 4 months ago

Hi

It looks like once there is a conflict, OSL keeps trying to resolve it forever which ends up using a lot of CPU. I see these repeating every second nonstop on Windows 10 Obsidian

The only way seems to restart it but then it starts doing it some many hours later once there is a conflict.

It would be very nice the newer file writes over and that is the end of it. If there is a way to bring back from history would be nice too in case the conflict resolutiopn does a bad job

OLS 0.22.0

Deleted, but there were more conflicts. 
45plugin:plugin-name:23736 Device:2/11/2024, 9:15:56 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts. 
74plugin:plugin-name:23736 Device:2/11/2024, 9:15:57 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts. 
156plugin:plugin-name:23736 Device:2/11/2024, 9:15:58 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts. 
158plugin:plugin-name:23736 Device:2/11/2024, 9:15:59 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts. 
147plugin:plugin-name:23736 Device:2/11/2024, 9:16:00 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts. 
155plugin:plugin-name:23736 Device:2/11/2024, 9:16:01 PM->Processing: @ANONYMIZED/xx.md: Conflicted revision has been deleted, but there were more conflicts.
.
.
.
.
.
.
.
vrtmrz commented 4 months ago

Hello! Thank you for opening the issue! It seems that 'Always reflect synchronized changes even if the note has a conflict' is enabled. Is this incorrect? (Your configuration would be appreciated. It can be copied from the Make report button on the hatch pane).

In that case, we might have a problem. Please disable this toggle.

However, I would like to know about how many conflicts your document has. Would you please perform Dump information of this doc from the command palette and let me know that?

gerroon commented 4 months ago

Yes "Always reflect synchronized changes even if the note has a conflict'" is enabled because I want the conflict to be resolved in favor of a newer file?

I think that document had only one , probably between twindows and ios client.

---- Obsidian info ----
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.5.3 Chrome/114.0.5735.289 Electron/25.8.1 Safari/537.36
---- remote config ----
cors:
  credentials: "true"
  headers: accept, authorization, content-type, origin, referer
  max_age: "3600"
  methods: GET,PUT,POST,HEAD,DELETE
  origins: app://obsidian.md,capacitor://localhost,http://localhost
chttpd:
  bind_address: any
  enable_cors: "true"
  max_http_request_size: "4294967296"
  port: "5984"
  require_valid_user: "true"
admins: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
vendor:
  name: The Apache Software Foundation
feature_flags:
  partitioned||*: "true"
chttpd_auth:
  authentication_redirect: /_utils/session.html
  hash_algorithms: sha256, sha
  require_valid_user: "true"
indexers:
  couch_mrview: "true"
prometheus:
  additional_port: "false"
  bind_address: 127.0.0.1
  port: "17986"
httpd:
  WWW-Authenticate: Basic realm="couchdb"
  bind_address: 0.0.0.0
  enable_cors: "true"
  port: "5986"
smoosh:
  state_dir: ./data
couch_httpd_auth:
  authentication_db: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
  secret: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
  authentication_redirect: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
couchdb_engines:
  couch: couch_bt_engine
couchdb:
  database_dir: ./data
  max_document_size: "50000000"
  single_node: "true"
  uuid: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
  view_index_dir: ./data

---- Plug-in config ---
version:0.22.4
couchDB_URI: self-hosted
couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
liveSync: false
syncOnSave: true
syncOnStart: true
savingDelay: 200
lessInformationInLog: false
gcDelay: 0
versionUpFlash: ""
minimumChunkSize: 20
longLineThreshold: 250
showVerboseLog: true
suspendFileWatching: false
trashInsteadDelete: true
periodicReplication: true
periodicReplicationInterval: 30
syncOnFileOpen: true
encrypt: false
passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
usePathObfuscation: false
doNotDeleteFolder: true
resolveConflictsByNewerFile: true
batchSave: false
deviceAndVaultName: ""
usePluginSettings: false
showOwnPlugins: false
showStatusOnEditor: true
showOnlyIconsOnEditor: false
usePluginSync: false
autoSweepPlugins: false
autoSweepPluginsPeriodic: false
notifyPluginOrSettingUpdated: false
checkIntegrityOnSave: false
batch_size: 50
batches_limit: 40
useHistory: true
disableRequestURI: true
skipOlderFilesOnSync: true
checkConflictOnlyOnOpen: false
showMergeDialogOnlyOnActive: false
syncInternalFiles: false
syncInternalFilesBeforeReplication: false
syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/,\/workspace$ ,\/workspace.json$,\/workspace-mobile.json$
syncInternalFilesInterval: 60
additionalSuffixOfDatabaseName: ""
ignoreVersionCheck: false
lastReadUpdates: 22
deleteMetadataOfDeletedFiles: true
syncIgnoreRegEx: .trash|sync.ffs_db|sync_ffs_lock
syncOnlyRegEx: ""
customChunkSize: 100
readChunksOnline: true
watchInternalFileChanges: true
automaticallyDeleteMetadataOfDeletedFiles: 0
disableMarkdownAutoMerge: false
writeDocumentsIfConflicted: true
useDynamicIterationCount: false
syncAfterMerge: true
configPassphraseStore: ""
encryptedPassphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
encryptedCouchDBConnection: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷
permitEmptyPassphrase: false
useIndexedDBAdapter: true
useTimeouts: false
writeLogToTheFile: false
doNotPaceReplication: false
hashCacheMaxCount: 300
hashCacheMaxAmount: 50
concurrencyOfReadChunksOnline: 100
minimumIntervalOfReadChunksOnline: 333
hashAlg: xxhash64
suspendParseReplicationResult: false
doNotSuspendOnFetching: false
useIgnoreFiles: true
ignoreFiles: .gitignore
syncOnEditorSave: true
pluginSyncExtendedSetting: {}
syncMaxSizeInMB: 200
settingSyncFile: ""
writeCredentialsForSettingSync: false
notifyAllSettingSyncFile: false
vrtmrz commented 4 months ago

Thank you for your detailed configuration! In this case, Always overwrite with a newer file is sufficient. Please try disabling Always reflect synchronized changes even if the note has a conflict once. I think that it will get a little better.

However, even if so, I started to think that it might be not good if several devices had this setting enabled at the same time...

gerroon commented 4 months ago

I will test it, thanks